aspose file tools*
The moose likes Servlets and the fly likes url-pattern tag of servlet-mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "url-pattern tag of servlet-mapping" Watch "url-pattern tag of servlet-mapping" New topic
Author

url-pattern tag of servlet-mapping

Lalit Kapoor
Greenhorn

Joined: Jun 06, 2004
Posts: 20
Can anyone tell me how to use <url-pattern> tag and why is used?
Ikram Soomro
Ranch Hand

Joined: Oct 20, 2001
Posts: 42
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url-pattern tag of servlet-mapping
 
Similar Threads
Head First Servlets: Beer Problem
*.do in web.xml file ?
jsp-property-group error in web.xml
Cannot find file..? Help
url-pattern tag in web.xml