Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Help !! Help needed very urgently

 
kripa ganesh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Am using Tomcat 3.2.1 and Servlets 2.1 for a small cart project. But whenever i use the post method the tomcat server it gives out an error that says Page could not be displayed because the service is not available..
Kindly help me on what i should do to get it working, is there any change i should make in the xml files to use the post method??
pls help
thanx
Kripa
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not up to your tomcat to accept post requests, its a problem of your servlets.
Be sure you have coded the doPost method in your servlet.
If you want the Post method to do the same as the Get method you can just call doGet() from the doPost.
HTH
 
Rishi Tyagi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear
You should try with the service method ,
Most probably you are using doGet method in the servlet which accept only HTTP GET requests and for the other HTTP requests you will receive the same error message what you are getting right now.
More specifically if you want this servlet accessible through HTTP POST request only then you can overwrite doPost method of HttpServlet Class.
If you want that your servlet should handle both HTTP GET and POST requests then you should use service method as it can accept both type of requests
Hope this will solve your problem
Rishi
 
kripa ganesh
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a lot for the timely help.. have solved the problem with your suggestions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic