在web.xml中配置文件路径classpath

来源:互联网 发布:traceroute windows 编辑:程序博客网 时间:2024/06/05 09:18

控制台报错:Invalid 'log4jConfigLocation' parameter: ServletContext resource   

<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>classpath:config/log4j.properties</param-value>
</context-param>  ( 我之前写的是classpath*: ,把*号去掉,这个问题就没了)
<listener>     

<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

=>> 至于网上对于这个异常的处理,对我的程序没有效果,我的问题不是出现在流的冲突上

java.lang.IllegalStateException异常产生的原因及解决办法

由于getWriter方法与在jsp页面中使用流相关的getOutputStream方法冲突,所以会造成这种异常,解决办法是:只需要在jsp页面的最后加上两条语句:   

                 out.clear(); 
                 out=pageContext.pushBody();

 

0 0
原创粉丝点击