Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml tags

 
Shweta R Dhaneshwar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to web programing.Can anyone tell me difference between these two in the web.xml
 
H Singh
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It defines the mapping between the name client uses ( /org.apache.jserv.JServ ) and the actual servlet class (org.apache.tomcat.servlets.StatusServlet )

<servlet-name> tag : You will use the name (status in your case) defined here within other parts of the DD

So when a request comes in,
1.the container finds <url-pattern> that has /org.apache.jserv.JServ.
2.then container gets the <servlet-name> ( status )
3.container looks in the <servlet> tag for <servlet-name> ( status )
4. then it uses the actual <servlet-class>

hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic