tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: unified doXXX()
Date Sun, 28 Feb 2010 15:26:15 GMT
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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Mime
View raw message