9
|
Vivek Kodira nehamishra25 · 技术社区 · 16 年前 |
![]() |
1
13
|
![]() |
2
6
我通常将原始HttpServletRequest包装成一个新的CustomHttpServletRequest,作为原始请求的代理,然后将这个新的CustomHttpServletRequest传递给过滤器链。
这是过滤器的一个示例:
|
![]() |
3
1
然后用原始参数+新参数构造另一个请求并再次发送。 HttpServletRequest是不可变的,无法更改它。 |
![]() |
4
1
您可以将HttpServletRequest包装到新的HttpServletRequestWrapper对象中,并覆盖一些方法。 http://www.ocpsoft.org/opensource/how-to-safely-add-modify-servlet-request-parameter-values/ . 要在筛选器中添加参数,请执行以下操作:
|
![]() |
5
0
为什么不将变量存储为请求范围属性,而不是尝试将它们附加到请求参数中? |
![]() |
6
-1
否则,可以使用强类型的setAttribute()方法。因此,可以使用getAttribute()方法。。。 |
![]() |
kristheman · 要求循环内的setAttribute 6 年前 |
![]() |
manus · 使用css的背景图像从servlet显示svg 6 年前 |
![]() |
Mimine · 使用servlet和jsp从SQL表中删除记录 6 年前 |
![]() |
Yura · 无法链接引导。min.css和动态web app 6 年前 |