This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes url-pattern tag of servlet-mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: url-pattern tag of servlet-mapping
 
Similar Threads
Cannot find file..? Help
*.do in web.xml file ?
Head First Servlets: Beer Problem
url-pattern tag in web.xml
jsp-property-group error in web.xml