What do you mean by "integrate"? JSPs have nothing to do with web services. Servlets are generally used for implementing web services, but the WS framework does that, you wouldn't have to write a servlet.
Tim Moores wrote:What do you mean by "integrate"? JSPs have nothing to do with web services. Servlets are generally used for implementing web services, but the WS framework does that, you wouldn't have to write a servlet.
I mean i have developed one web service and now i want to call that web service on click of button from a jsp page. How can that be achieved using spring.
Joined: Sep 21, 2011
Not sure what Spring has to do with this - are you using some WS library that's related to Spring? If so, there's probably a page that lists all available WS and their URLs; the documentation should tell you where to find that.
Then you'd use the URL of that service in your HTML/JSP page (maybe as the action attribute of a form that gets submitted at the click of a button).
You basically have to write a web service client.
If you want to call as web service from click of a button on a jsp then below is what you would have to do:
1. Write a jsp page which takes in input parameter for the web service method
2. Write a servlet to recieve the request from the jsp and get all the input parameters
3. Generate the web service client side artifacts
4. Call the web service using the client proxie. This code for calling can be written in the servlet itself
5. Recieve the response from web service. Use that response to populate the result jsp
I do not know if spring provides all of this automatically. These are the steps you would need to do to invoke a web service from a jsp.
PS: Calling a web service from a jsp makes sense only if you are consuming web services in your web application.
At this point, the OP already has written the web service using Spring. He just wants to call a web service from a button on the JSP page, so actually, this isn't a Spring questions. This is just a simple. What is the URL for the web service and call it from the button on the page.
I am moving this back to the JSP forum. Which I am assuming is where it originated.