如何将请求从DynamohttpservletRequest传递到(ServletRequest或httpservlet



我的应用程序正在运行ATG。我也添加了滤镜。登录时(使用ATGFORM(,我正在传递一个参数。我能够在Dynamohttpservletrequest中获得该参数。但是,在转发或重定向到某个JSP页面之后,我无法在过滤器中获取该参数。

过滤器servlet如下:

public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)

我无法在request中获得相同的参数。我在这里缺少什么?

您可以关注Doc以获取更多信息:https://docs.oracle.com/cd/e35319_01/platform.10-2/atgplatformprogguide/html/s0704filterexample01.html

import atg.servlet.ServletUtil;
import atg.servlet.DynamoHttpServletRequest;
import atg.servlet.DynamoHttpServletResponse;
import javax.servlet.*;
import javax.servlet.http.*;

public class MyFilter
  implements Filter {
   public void doFilter(ServletRequest request,
                       ServletResponse response,
                       FilterChain chain)
    throws IOException, ServletException
  {
    // Get the Dynamo Request/Response Pair
   DynamoHttpServletRequest dRequest =
         ServletUtil.getDynamoRequest(request);
   // Get param value
   String paramValue =
     (String)dRequest.resolveName("paramName");
   // Pass control on to the next filter
   chain.doFilter(request,response);
   return;
  }
}

相关内容

  • 没有找到相关文章

最新更新