Classes known to DWR:
我刚学到ajax没几天 用Ajax时(也用spring了)就出现Classes known to DWR:
问题就是 我导入dwr.jar 配置好web.xml和dwr.xml
然后部署项目 在ie中输入http://localhost:8080/epet/dwr/index.html
页面中只显示Classes known to DWR: 什么也没有了 更没有公布的方法
好心的前辈们,教教虚心学习的后背吧,谢谢啦,帮帮忙
dwr.xml文件就放在WEB-INF下 内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">
<dwr>
<allow>
<create creator="spring" javascript="JUserCheck">
<param name="beanName" value="petInfoBizImpl" />
<param name="location" value="classpath:di.xml" />
</create>
</allow>
</dwr>
web.xml 内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>dwr</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>
<servlet-mapping>
<servlet-name>dwr</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.aptech.jb.epet.util.Util</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
spring配置文件 di.xml 内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http:www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- sessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation" value="/WEB-INF/classes/hibernate.cfg.xml">
</property>
</bean>
<!-- diaryDao -->
<bean id="petDiaryDao"
class="com.aptech.jb.epet.dao.impl.PetDiaryDaoImpl" >
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- diarybiz -->
<bean id="petDiaryBizImpl"
class="com.aptech.jb.epet.biz.impl.PetDiaryImpl">
<property name="petDiaryDao" ref="petDiaryDao" />
</bean>
<!-- 通知 -->
<bean id="beforeAdvice"
class="com.aptech.jb.epet.advice.BeforeAdvice">
<property name="petDao" ref="petInfoDao" />
</bean>
<!--代理类 -->
<bean id="diaryBiz"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.aptech.jb.epet.biz.PetDiaryBiz</value>
</property>
<property name="interceptorNames">
<list>
<value>beforeAdvice</value>
</list>
</property>
<property name="target" ref="petDiaryBizImpl" />
</bean>
<bean name="/diary"
class="com.aptech.jb.epet.web.action.DiaryAction">
<property name="petDiaryBiz" ref="diaryBiz" />
<property name="petInfoBiz" ref="petBiz" />
</bean>
<!-- petInfoDao -->
<bean id="petInfoDao"
class="com.aptech.jb.epet.dao.impl.PetInfoDAOJdbcImpl" >
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- petInfoBiz -->
<bean id="petInfoBizImpl"
class="com.aptech.jb.epet.biz.impl.PetInfoBizImpl">
<property name="petInfoDao" ref="petInfoDao" />
</bean>
<!-- 后置通知 -->
<bean id="lotteryAdvice"
class="com.aptech.jb.epet.advice.LotteryAdvice">
<property name="petDao" ref="petInfoDao" />
</bean>
<!-- 代理类 -->
<bean id="petBiz"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>com.aptech.jb.epet.biz.PetInfoBiz</value>
</property>
<property name="interceptorNames">
<list>
<value>lotteryAdvice</value>
</list>
</property>
<property name="target" ref="petInfoBizImpl" />
</bean>
<!-- action -->
<bean name="/pet" class="com.aptech.jb.epet.web.action.PetAction">
<property name="petInfoBiz" ref="petBiz" />
</bean>
</beans>
问题就是 我导入dwr.jar 配置好web.xml和dwr.xml
然后部署项目 在ie中输入http://localhost:8080/epet/dwr/index.html
页面中只显示Classes known to DWR: 什么也没有了 更没有公布的方法