Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

servlet filter

Hi,

I am going thorugh below example

http://www.javatpoint.com/servlet-filter


When i click on Index.html link i was lead to below url
http://localhost:8080/Filter/servlet1
with


message diplayed as below on the page(or browser? what is difference)

filter is invoked before
welcome to servlet
filter is invoked after


I wonder what below line do

chain.doFilter(req, resp);

please advise
Any links resources ideas highly appreciated. Thanks in advance
SOLUTION
Avatar of Ken Butters
Ken Butters
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

I see
<filter>  
<filter-name>f1</filter-name>  
<filter-class>MyFilter</filter-class>  
</filter>  
   
<filter-mapping>  
<filter-name>f1</filter-name>  
<url-pattern>/servlet1</url-pattern>  
</filter-mapping>

Filter is configured for servlet1 so

chain.doFilter(req, resp);

leads to servlet1 right. please advise
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial