首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

警告: Can't find ServletContext to check for <welcome-file-list> in web.xml

2012-06-29 
警告: Cant find ServletContext to check for welcome-file-list in web.xml.警告: Cant find Servle

警告: Can't find ServletContext to check for <welcome-file-list> in web.xml.

警告: Can't find ServletContext to check for <welcome-file-list> in web.xml. Assuming defaults.2011-9-30 14:21:32 org.directwebremoting.impl.DefaultPageNormalizer normalizePage警告:  - To prevent this message from happening, either call the PageNormalizer from a DWR thread2011-9-30 14:21:32 org.directwebremoting.impl.DefaultPageNormalizer normalizePage警告:  - Or seed the PageNormalizer with a ServletContext before access from outside a DWR thread


因为使用了dwr的推送技术,在初始化web.xml时就需要将类初始化,而这个时候根本就没有网页调用这个类,当然报这样的错误了。

解决方法参考如下:http://directwebremoting.org/dwr/documentation/reverse-ajax/threads.html
添加如下红色内容即可

WebContext wctx = WebContextFactory.get();
sctx = ServerContextFactory.get(wctx.getServletContext());
wctx.getScriptSessionsByPage("");

热点排行