因为使用了struts2的静态内容加载的特性(http://struts.apache.org/2.2.3/docs/static-content.html)导致了该问题。


解决方案[对2.3.3以下版本有效,2.3.4版本同样出现异常,但异常位置已不在这里]:

1. 自定义StaticContentLoader覆盖默认的DefaultStaticContentLoader,并修改struts配置文件指定使用新的StaticContentLoader实现类。


Xml代码 
  1. <constant name="struts.staticContentLoader" value="coo.struts.config.GenericStaticContentLoader" />


2. 覆盖DefaultStaticContentLoader的findStaticResource方法,加入为空判断处理。


网友评论