Maxim,
now I don't understand your problem. You don't have to transform the
request.
If you're using this
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
req.setAttribute(somekey, someobject);
doGet(req, res);
}
might it work. I think, you don't have to do more than this.
Uwe
-----Ursprungligt meddelande-----
Fran: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]For Maxim
Patramanskij
Skickat: den 12 februari 2002 16:02
Till: [EMAIL PROTECTED]
Amne: Re: SV: SV: Forwarding from POST to GET
Hello Klosa,
yes, I tried.
But setting an additional attribute wouldn't be a
problem, if it would be possible to change the status of request
object as like it was created via GET request. But, once it created by
POST, it remains "POSTed" till the end of it's life.
Additionally, HttpServletRequest has getMethod() method, which returns,
also HTTP method :), but it has not setMethod(String method) :(.
Max
KU> Hi Maxim,
KU> have you tried to use
KU> req.setAttribute(java.lang.String key, java.lang.Object o);
KU> in the doPost. I've never tried it for myself, but I found examples in
KU> several books.
KU> Regards
KU> Uwe
KU> -----Ursprungligt meddelande-----
KU> Fran: A mailing list for discussion about Sun Microsystem's Java Servlet
KU> API Technology. [mailto:[EMAIL PROTECTED]]For Maxim
KU> Patramanskij
KU> Skickat: den 12 februari 2002 13:49
KU> Till: [EMAIL PROTECTED]
KU> Amne: Re: SV: Forwarding from POST to GET
KU> Hello Klosa,
KU> the thing, you propose, will work if I would send exactly the same
KU> query parameters, but using different methods. But, I want to POST some
KU> data, then add some parameters to request and forward it to doGet.
KU> However, it seems to be impossible.
KU> Max
KU>> Maxim,
KU>> try this:
KU>> public void doPost(HttpServletRequest req, HttpServletResponse res)
KU>> throws ServletException, IOException {
KU>> doGet(req, res);
KU>> }
KU>> Hope this helps!
KU>> Uwe
KU>> -----Ursprungligt meddelande-----
KU>> Fran: A mailing list for discussion about Sun Microsystem's Java
Servlet
KU>> API Technology. [mailto:[EMAIL PROTECTED]]For Maxim
KU>> Patramanskij
KU>> Skickat: den 12 februari 2002 11:37
KU>> Till: [EMAIL PROTECTED]
KU>> Amne: Forwarding from POST to GET
KU>> I've tried to forward POST request to the same servlet, but
KU>> transforming it to GET by adding some query string, but I've got the
KU>> looping and then crash of tomcat 3.3.
KU>> I realized, that it isn't possible to forward from POST to GET and
KU>> vice versa. I didn't found any mentioning about this problem in
KU>> Servlet API specification(both 2.2 and 2.3).
KU>> Max
___________________________________________________________________________
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
___________________________________________________________________________
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