File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url-pattern tag of servlet-mapping

 
Lalit Kapoor
Greenhorn
Posts: 20
  • 0
  • 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
  • 0
  • 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)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic