Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JSP->XML->Servlet

Status
Not open for further replies.

slok

Programmer
Jul 2, 1999
108
SG
Is it possible to generate XML content dynamically
by receiving input values from a JSP at runtime?
The generated XML will then be sent to a servlet.

Eg.
Assume a JSP with 2 text boxes, and user enter 2 parameter
a=10 and b=20, then the JSP will generate a XML doc and send
that doc to the servlet.

The servlet after receiveng the following xml doc parses
it.


xml doc
//-----------------------------------
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE Request SYSTEM
&quot;C:\DTDs\XMLs\RequestHeaderDTD.dtd&quot;>
<Request>
<Header>
<paramA>10</paramA>
<paramB>10</paramB>
</Header>
</Request>
 
What purpose would this serve? What exactly are you trying to accomplish?

You could have the JSP spit out XML and add it as an attribute to the Request and then forward the request to the Servlet via a RequestDispatcher. The big question is what do you gain by doing this? The JSP could just directly forward() the request and the Servlet could grab the parameters or even better the JSP could directly submit to the Servlet. Wushutwist
 
I fully agree with wushutwist ....
needless to say it would be really unnecessary to go about the way you are trying to do it..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top