Win a copy of Mesos in Action this week in the Cloud/Virtualizaton 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