Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter not working with jsp:include

 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My filter works for direct requests to the web server but not for requests that come from included JSP pages.

For example, I have this filter mapping for a.jsp and b.jsp. In a.jsp, I have included this: <jsp:include page="b.jsp"/>

<filter-mapping>
<filter-name>FilterRequestTest</filter-name>
<url-pattern>/a.jsp</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>FilterRequestTest</filter-name>
<url-pattern>/b.jsp</url-pattern>
</filter-mapping>

The filter works for a.jsp but does not work for b.jsp.

I am wondering:
would <dispatcher>INCLUDE</dispatcher> resolve my problem ?
Since this is an included request (not dispatched though).

Thanks.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes
it might help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic