Question

How can I put an attribute into the JSP PageContext for the current request (so that it becomes accessible via ${myVar} ) from a Filter that runs before the JSP?

Was it helpful?

Solution

I think I may be missing something, but:

  • you have the ServletRequest object in the filter
  • call request.setAttribute("myVar", value);
  • call chain.doFilter(request, response);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top