xiaokun6
小坤_Android
采纳率0%
2016-07-23 11:09 阅读 1.2k

java web 项目问题,请大神帮帮忙

5

首次使用idea从svn当下elicpse项目导入,配置完成运行出现这样的错误。

HTTP Status 500 - Filter execution threw an exception

type Exception report

message Filter execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Filter execution threw an exception
com.rongyi.common.XssFilter.doFilter(XssFilter.java:23)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

java.lang.ExceptionInInitializerError
com.rongyi.filter.CheckSessionOutFilter.doFilter(CheckSessionOutFilter.java:42)
com.rongyi.common.XssFilter.doFilter(XssFilter.java:23)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
root cause

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.String.substring(String.java:1967)
com.rongyi.common.utils.Constant.getpath(Constant.java:82)
com.rongyi.common.utils.Constant.(Constant.java:69)
com.rongyi.filter.CheckSessionOutFilter.doFilter(CheckSessionOutFilter.java:42)
com.rongyi.common.XssFilter.doFilter(XssFilter.java:23)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
note The full stack trace of the root cause is available in the Apache Tomcat/9.0.0.M9 logs.

Apache Tomcat/9.0.0.M9

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<!-- spring框架必须定义ContextLoaderListener,在启动Web容器时,自动装配Spring applicationContext.xml的配置信息 -->

org.springframework.web.context.ContextLoaderListener


<!-- 指定Spring上下文配置文件 -->
contextConfigLocation
classpath*:applicationContext.xml


spring.profiles.active
production


Dispatcher
org.springframework.web.servlet.DispatcherServlet

<!-- 指定SpringMVC配置文件 -->
contextConfigLocation
/WEB-INF/springmvc.xml


<!-- 指定请求的后缀,可以随意写,这里用.html作为请求后缀 -->
Dispatcher
<!-- *.html -->
/

<!-- 编码格式为UTF-8 -->

encodingFilter
org.springframework.web.filter.CharacterEncodingFilter

encoding
UTF-8


forceEncoding
true



encodingFilter
/*

<!-- 过滤sql注入,对传入的参数过滤特殊字符等 -->

XssFilter
com.rongyi.common.XssFilter


XssFilter
/*

<!-- 检查session是否过期filter -->



CheckSessionFilter



com.rongyi.filter.CheckSessionOutFilter




CheckSessionFilter

/*


index.jsp

请帮帮忙跪求。。。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • xiaokun6 小坤_Android 2016-07-23 11:12

    可以进入index.jsp,但是别的页面就无法进入就包这个错误,跪求

    点赞 评论 复制链接分享
  • FiangAsDre GreenRookie 2016-07-25 10:22

    看看lib中的包都加载了吗

    点赞 评论 复制链接分享
  • CODER_V 无道loading 2016-07-26 09:27

    javax.servlet.ServletException: Filter execution threw an exception

    点赞 评论 复制链接分享

相关推荐