tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Brogden <wbrog...@bga.com>
Subject Re: getParameter vs getInputStream
Date Tue, 25 Apr 2000 16:42:16 GMT
You may just have to go with a plain Servlet 
service method  entry point that
redirects to JSP instead of starting with a JSP.

Matthew Jones wrote:
> 
> Thanks for the response (and to the others that responded).  I believe I am
> complying with the rules you specified below.  The following is my JSP
> (dashes added to the email only for clarity):
> 
> ----------------------------------------------------------------------------
> ----------
> <%@ page import="mj.xml.*" %>
> <jsp:useBean id="xmlBean" class="mj.xml.XmlBean" />
> <% xmlBean.init(); %>
> <%= xmlBean.request(request.getInputStream(),request.getContentLength()) %>
> ----------------------------------------------------------------------------
> ----------
> 
> Note that nowhere do I call any getParameter methods!  I checked the
> servelet that is created and it does not use any getParameter methods.
> 
> I believe this is pretty strong evidence that Tomcat will parse the input
> into parameters regardless of what is in the JSP!  This seems like a pretty
> big problem to me.
> 
> Note:  I don't want to use any getParameter method, I really just want to
> read a raw input stream.
> 
> Matthew Jones
> matthew@pacificsw.com
> 
> > The circumstances under which a servlet container will read the data
> > content of your request are documented in the Servlet API Specification,
> > version 2.2, section 5.1.  Essentially, all of the following have to be
> > true:
> >
> > * The request came in via HTTP or HTTPS
> >
> > * The request method is POST, not GET
> >
> > * The content type is "application/x-www-form-urlencoded"
> >   (which is what browsers use for post requests)
> >
> > * The servlet calls one of the getParameter()
> >   family methods.
> >
> > If all of these are true, a servlet won't be able to use the input
> > stream.  Because a JSP page is compiled to a servlet, it falls under the
> > same restrictions.  If you change one of these conditions, you will be
> > able to read the input stream, but you won't be able to use
> > getParameter() to read parameters included in the input stream -- so
> > there is a tradeoff.
> >
> > Craig McClanahan
> >
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

-- 
WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
Java Programmer Certification information and mock exam
at  http://www.lanw.com/java/javacert/

Mime
View raw message