I am trying to call a servlet on button click.Its not a submit button,but a graphical button (not a part of form).
When i click the button get the message:
HTTP STATUS 405:HTTP method GET is not supported by this URL.
The specified HTTP method is not allowed for the requested resource.
When i reference a jsp page it displays the page.Is there any way that I can call a SERVLET and send some information along the servlet name.If yes ,what should be the code?
Originally posted by Ghazala Islam :
Is there any way that I can call a SERVLET and send some information along the servlet name.If yes ,what should be the code?
I am afraid you cannot do that with servlets. Servlets only process the requests through the service() or doGet() or doPost() methods. You have to use a form with one of these methods to access the service methods. Clicking a graphical button without a from cannot take you to a servlet. There is no other way. Lets say if even if you send parameters in the URL, how will you invoke the service methods? You got to re-adjust your application.
Originally posted by rao raghu:
Clicking a graphical button without a from cannot take you to a servlet.
in doget method of servlet...get values of parameter via request.getParameter("userId")
One more question,how can i associate a dyanamic value with a url,as usually we append fixed value with url as below,
but what if company id changes everytime?