Hi

There's been a lot of discussion concerning B2B using XML and servlets.
Outputing XML from servlets seem straightforward.  Having servlets receive
XML input seems less defined.

I've looked at various examples on the web concerning XML documents as input
to Servlets and seen the following approachs:

1.  Override the "service" method.  Get the inputstream and pass it into the
XML parser.
2.  Override the "doPost" method.  Get the inputstream and pass it into the
XML parser.
3.  Override the "doPost" method.  Get action parameter from querystring
using request.getParameter(), then get the inputstream and pass it to XML
parser.
4.  Override the "doPost" method.  Get the inputstream, pass it into
HttpUtils.parsePostData.  User the returned hashtable to populate an XML
document.  This is a strange one, since most servlet container
implementations probably use HttpUtils.parsePostData to implement
request.getParameter.  So, it's more straightforward just to use
request.getParameter.

Using HTTP POST is expected since it imposes no limits on the information
that can be sent.  Overriding the "service" method might be feasible
depending on whether the servlet's ONLY job is to process XML document or it
also does double duty serving dynamic web pages.

Is there a reason why most servlets receive XML documents via
ServletRequest.getInputStream instead of using ServletRequest.getParameter
(via HTTP POST)?  The benefits is not having to read the inputstream
directly, just getting a String object representing the XML document which
is returned by the getParameter method.

Thanks
Albert

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to