Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem referencing a servlet from a html

 
Ventris Learchus
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys ,

I'm having a problem as shown here http://stackoverflow.com/questions/15908994/call-servlet-from-jsp-and-use-if

Basically I want to send the info from me html form to a servlet , upon reaching the servlet i want to then display a button to let the user proceed to a jsp page .


I'm not sure where I'm going wrong , I've googled several tutorials but can't find anything that works , I'm assuming I've left something simple out , ...in my html the form is declared as this <form id="form" name="form" method="post" action="RegistrationServlet" >


the xml looks like this


 
Devaka Cooray
Marshal
Pie
Posts: 4894
409
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ventris Learchus wrote:
<servlet-path>Quiz/Quiz.RegistrationServlet</servlet-path>

This has to be <servlet-class>fully.qualified.ClassName</servlet-class>

Example for if your RegistrationServlet class is packaged in 'com' package:
<servlet-class>com.RegistrationServlet</servlet-class>
 
Ventris Learchus
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i made the change you suggested and it seem to have worked however I am now getting the following error
screen.png
[Thumbnail for screen.png]
 
Devaka Cooray
Marshal
Pie
Posts: 4894
409
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What that simply says is your form sends data in HTTP POST request, and your servlet does not have a doPost(-) method declared in it.
 
Ventris Learchus
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a snippet of the servlet code
 
Ventris Learchus
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nvm , after adding a dopost method i cleaned the solution and that fixed it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic