Hello...
I have a servlet that accepts an XML request (via HTTP post) and
responds with an XML output. Now, my question is - Is it possible to
respond with output to a JSP page?
Scenario.....
User sends XML request to servlet.
Servlet processes request. OK
Servlet responds by outputting the result to a JSP page.
How can this be done? Code snippets are welcome.
Thanks muchly.....
Harry H.
castillo.bryan@gmail.com - 21 Dec 2005 05:48 GMT
Look at these methods:
(I think that you meant - Is it possible to respond with output
generated by a JSP page?)
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getReque
stDispatcher(java.lang.String)
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html#forwa
rd(javax.servlet.ServletRequest,%20javax.servlet.ServletResponse)
JScoobyCed - 21 Dec 2005 07:04 GMT
> Servlet responds by outputting the result to a JSP page.
If you mean injecting the result to a page that is already displayed in
the client browser: you can't... Or not using this scenario.
There is a JavaScript method that let you perform XML HTTP request. The
result is return in a String variable that you can process in your
javascript code and dynamically display.
This is not specific to Java but Javascript.

Signature
JSC
Malte - 21 Dec 2005 08:25 GMT
I have written entire systems based on XML being sent back to the
browser. I preferred XSLT transformation over JavaScript.