How I can redirect a page using post method?

Hi all,

Ive a form which send some data by post method to a jsp page. After that, I do some management and then I d like redirect to another page using post method and, of course, adding or exchanging some data in the form. Is it possible?

I dont want to use request.sendRedirect method. Because it uses get method and it s put everything on the URL. I need send using post method.....

Ill pay for that. :))))

[441 byte] By [rgoliveira] at [2007-9-26 1:30:28]
# 1
try RequesterDispatcher..
sribk at 2007-6-29 1:28:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You can try the jsp:forward. <jsp:forward page="newPage.jsp"> <jsp:param name="somename" value="somevalue" /></jsp:forward>
mbarsic at 2007-6-29 1:28:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I tryied do that but didnt work. I tryied change the value of a field but nothing...

Did you do something like that?

> You can try the jsp:forward.

> > <jsp:forward page="newPage.jsp">

> <jsp:param name="somename" value="somevalue" />

> </jsp:forward>

>

rgoliveira at 2007-6-29 1:28:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Ok, probably works but how I can change the value of a request value?

For example:

In my jsp page I have

<form method="post" action="test.jsp">

<input type="hidden" name="field1" value="1">

...

In test.jsp ....

String tmp = request.getParameter("field1");

if (tmp.equals("1")) tmp = "2";

... now I need redirect to page test2.jsp sending the new value. Thats the problem. How I can update the request object with this value or how create a new (HttpServletRequest) to use with RequesterDispatcher?

Tanks for help.....

> try RequesterDispatcher..

rgoliveira at 2007-6-29 1:28:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...