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

invoking servlet through html in eclipse

 
payal Jain
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to invoke servlet through html in eclipse where my form action in html is
<FORM ACTION="/MyTomcat/Coreservlet.threeparams">

MyTomcat is root folder,Coreservlet is folder inside WEB-INF/src & threeprams is class.
My html runs properly but when i submit page it gives 404 error.
Is there any mistake in the path i am giving.
please help me out..
 
Jeff Rummings
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add your servlet to web.xml?



[ December 20, 2007: Message edited by: Arman Sharif ]
[ December 20, 2007: Message edited by: Arman Sharif ]
 
payal Jain
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you it worked.I dint registered my servlet in web.xml.
but why it is needed to register servlet in web.xml,although i am invoking it through html.OR Is it neccessary to register every servlet in xml file.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18272
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is necessary to register every servlet. It didn't used to be that way, but there were serious security problems with that approach.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic