Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling servlet from jsp

 
sing
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use <jsp:forward> to calling my servlet but an error come out. My servlet has only doGet().
This is my code.
<jsp:forward page="/servlet/TestingServlet" />
<jsp aram name="name" value="value" />
</jsp:forward>
Error:
HTTP method POST is not supported by this URL
steffy
[ September 23, 2002: Message edited by: Steffy Sing ]
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steffy Sing:
I use <jsp:forward> to calling my servlet but an error come out. My servlet has only doGet().
This is my code.
<jsp:forward page="/servlet/TestingServlet" />
<jsp aram name="name" value="value" />
</jsp:forward>
Error:
HTTP method POST is not supported by this URL
steffy
[ September 23, 2002: Message edited by: Steffy Sing ]

that means that the HTTP method POST is not supported by this URL.
try putting a doPost method in your servlet and inside that method call the doGet method. What I usually do is to have a method like this one:

cheers
 
chanoch wiggers
Author
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alternatively, you can also add
method="GET" to force the form to be submitted using get rather than post
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic