On 28/02/2010 02:00, Aryeh M. Friedman wrote:
I am refactoring a servlet we have used successfully for several years
now to accommodate input that does not amen itself to
HttpServletRequest.getParameter()... The only way it seems to be to
handle our particular input (the nature/format of the input is covered
by an NDA so I can not discuss it in any detail) read the raw
request.... in the old servlet HttpServletRequest.getParameter() had a
nice side effect that we where able to do something like this:

I don't understand, can you explain what you mean by a side effect?

public void doGet(HttpServletRequest request,HttpServletResponse response)
throws IOException
{
handleRequest(request,response);
}

public void doPost(HttpServletRequest request,HttpServletResponse response)
throws IOException
{
handleRequest(request,response);
}


private void handleRequest(HttpServletRequest
request,HttpServletResponse response)
{
String input=Request.getParameter("foo"); // we are only interested in
this one param

"Request" or "request" - is this a typo?

process input
}

I want to preserve the single handler design but since getParameter
barfs on our new input format and there is no unified raw input reader
the only thing I can think of is make it so doGet and doPost use
request.getQueryString() and request.getReader() respectivally... is
there an easier way? (namely I want to keep doXXX as pure wrappers with
nothing but a dispatch to handleRequest()).

Why does request.getParameter() not work, or is that a secret?

Is request.getInputStream() not suitable?

As far as I can see, there's absolutely no reason that handleRequest won't continue to work, as long as the code inside actually does work.


p


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to