Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applying filter for a JSP page using servlet-name

 
Wasim Ayoubi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have tried to configure a filter using the servlet name of a JSP file but it did not work, does anybody have any comment ?

DD looks like this

<filter>
<filter-name>Request Logging Filter</filter-name>
<filter-class>filters.RequestLoggingFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>Request Logging Filter</filter-name>
<servlet-name>indexpage</servlet-name>
</filter-mapping>

<servlet>
<servlet-name>indexpage</servlet-name>
<jsp-file>/index.jsp</jsp-file>
</servlet>
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:

<filter>
<filter-name>Request Logging Filter</filter-name>
<filter-class>filters.RequestLoggingFilter</filter-class>
</filter>
<!-- I have changed the <servlet-name> to <url-pattern>
<filter-mapping>
<filter-name>Request Logging Filter</filter-name>
<url-pattern>/index.jsp</servlet-name>
</filter-mapping>
 
Wasim Ayoubi
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I know it will work by using url-pattern but I want to know if it will work using servlet-name for a JSP file (if it is possible).

what do you think !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic