Thursday, 15 September 2011

java - Is there a way to forward a POST as a GET? -



java - Is there a way to forward a POST as a GET? -

i know forwards preserves everything, including method. there way around forwarding post get?

i.e. there way create forwards below become page forwards can access session attribute?

@override protected void dopost(final httpservletrequest req, final httpservletresponse resp) throws servletexception, ioexception { ... req.setattribute("session", session); req.getrequestdispatcher("/mypage.jsp").forward(req, resp); }

see httpservletrequestwrapper.

you wrap request getmethod() returns get pass wrapped request request dispatcher.

java servlets http-post forwarding

No comments:

Post a Comment