来自servlet的Java重定向删除了查询字符串

时间:2016-07-08 03:12:41

标签: java jsp servlets

我有一个maven网络应用程序,可以进行身份​​验证,但成功登录后会删除我的网址参数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 个答案:

答案 0 :(得分:0)

我认为您在过滤器代码中使用了网址重写功能。 过滤器的dofilter方法有请求和响应对象。检查你的dofilter方法

相关问题