• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Registration in web.xml??

 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Is it possible to run a servlet wihtout register it in the web.xml. For all servlets, I have to give <servlet> and <servlet-mapping> in the web.xml..

Whether it is mandatory..? for testing purpose how can we ignore it? If so, what are the drawbacks of not resigtering the servlet in web.xml
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is required that we define the Servlet/ServletMapping in Deployment Descriptor but not sure about previous versions
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some servlet containers (e.g. Tomcat) have a mechanism like the InvokerServlet which allows to use servlets wothout specifying them in web.xml, just by using their classname. This approach has numerous drawbacks which are outlined in that page.

Since this is not a standard Servlet API feature I suspect that it can't possibly be covered in the exam.
 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer..


Since I am preparing for SCWCD exam, I don't prefer to use any IDE, though I already worked my projects with Eclipse..

I am just using Notepad for all the xml,servlets and JSP and each and every time, If i am writing a new servlet, I have to type all the servlet mapping in the web.xml.. that's why I have asked...

Thanks for the link...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic