Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet-mapping  RSS feed

 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys
is <servlet-mapping> mandatory for all <servlet> tags in web.xml
i have also read that every <servlet> tag should have <servlet-mapping>
but i found only <servlet> tag for quartz configuration like below


i also found quartz timier is working properly
also my application is running properly
looking for your replies
amir
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A mapping is only needed if you want to hit your servlet from the web.
It looks like Quarts is using this servlet for initialization purposes only (so it needs no mapping to be hit from the web).

Note: I'm guessing this code is somewhat old. Starting with Servlet Spec 2.3, the preferred way to initialize web applications is to use a context listener; not a servlet. These days, there is no reason why servlets should be written to do anything other than respond to HTTP requests.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!