我有一个maven web应用程序,它执行身份验证,但成功登录后,它删除我的URL参数 debug
http://localhost:8080/TestProject/?debug
更改为 - > http://localhost:8080/TestProject/
我在index.html页面中使用那个parm作为一些逻辑
不知道我做了什么来实现这一目标
这是我的web.xml
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>Servlet 3.0 Web Application</display-name>
<welcome-file-list>
<welcome-file>test/index.html</welcome-file>
</welcome-file-list>
<display-name>Archetype Created Web Application</display-name>
<filter>
<filter-name>AuthFilter</filter-name>
<filter-class>com.test.AuthClass</filter-class>
</filter>
<filter-mapping>
<filter-name>AuthClass</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
</web-app>
如果你需要了解更多,请告诉我
1 回答
我认为你在过滤器代码中使用了url重写 . Filter的dofilter方法有请求和响应对象 . 检查你的dofilter方法