浏览 1635 次
锁定老帖子 主题:扩展DWR按目录加载配置文件
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2012-04-26
通过查看DWR源代码,有了一个解决方案供大家参考,直接上源码啦。 1.修改WEB.XML关于DWR的配置 <!-- dwr. --> <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>activeReverseAjaxEnabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>initApplicationScopeCreatorsAtStartup</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>maxWaitAfterWrite</param-name> <param-value>500</param-value> </init-param> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>customConfigurator</param-name> <param-value>com.linkage.util.web.DwrDirConfigurator</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> 2.添加com.linkage.util.web.DwrDirConfigurator java实现类 -------------------------------------------------------- 官方提供的多配置文件加载方式: <init-param> <param-name>config-system</param-name> <param-value>/WEB-INF/classes/dwr/dwr-system.xml</param-value> </init-param> <init-param> <param-name>config-grid</param-name> <param-value>/WEB-INF/classes/dwr/dwr-grid.xml</param-value> </init-param> <init-param> <param-name>config-gisPlatform</param-name> <param-value>/WEB-INF/classes/dwr/dwr-gisPlatform.xml</param-value> </init-param> <init-param> <param-name>config-spring</param-name> <param-value>/WEB-INF/classes/dwr/dwr-spring.xml</param-value> </init-param> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |