This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url-pattern tag of servlet-mapping

 
Lalit Kapoor
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to use <url-pattern> tag and why is used?
 
Ikram Soomro
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to use <url-pattern> tag and why is used?


<web-app>
<servlet>
<servlet-name> login</servlet-name><servlet-class> edu.su.LoginServlet </servlet-class>
</servlet>

<servlet-mapping>
<servlet-name> login</servlet-name>
<url-pattern> *.html </url-pattern>

</servlet-mapping>

<web-app>


you can apply pattern on any url in your web application.
*.html
If some url contain any name . html than it should be referred to LoginServlet

Ikram Soomro
(SCJP2,SCWCD)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic