tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aryeh M. Friedman" <aryeh.fried...@gmail.com>
Subject unified doXXX()
Date Sun, 28 Feb 2010 02:00:10 GMT
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:

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

    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()).

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


Mime
View raw message