只要一在Spring 配置文件里配置 就报错 我都检查了,没发现我语法错误,真无语了啊
[code="java"]
<bean id="testDao" class="org.test.dao.TestDao">
<property name="sessionFactory" ref="sessFactory"></property>
</bean>
<bean id="testService" parent="txProxyTemplate">
<property name="target">
<bean class="org.test.service.Services">
<property name="testdao" ref="testDao"></property>
</bean>
</property>
</bean>
<!--DWR的配置<bean id="dwr" class="org.test.dwr.TestDwr">
<property name="services">
<ref bean="testService" />
</property>
</bean>-->
[/code]
DWR.xml配置
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
[/code]
web.xml配置
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
action
org.apache.struts.action.ActionServlet
config
/WEB-INF/struts-config.xml
debug
3
detail
3
0
<!-- DWR -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<!-- /DWR -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- DWR -->
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<!-- /DWR -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Spring监听 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Spring监听 -->
[/code]
java代码
[code="java"]
public class TestDwr {
private Services services;
public Services getServices() {
return services;
}
public void setServices(Services services) {
this.services = services;
}
public String hehe(String ha){
return ha+"嘿嘿";
}
}
[/code]
[b]问题补充:[/b]
工程就404错误啊,没异常哦
[b]问题补充:[/b]
现在的问题是,根本找不到工程 如果去掉Spring的那个配置 可以找到工程
/dwr 也是404 无法测试啊