Reputation: 307
now am trying to redirect to action class from action class with some parameters in my Struts 1.3 web application, here is my code
ActionRedirect redirect = new ActionRedirect(mapping.findForward(forwardPage));
redirect.addParameter("method", forwardPage);
redirect.addParameter("username", "user");
redirect.addParameter("password", "PWD");
redirect.addParameter("forwardPage", "success");
return redirect;
it's working fine, but all parameters are showed in address bar, how can i redirect it as POST request parameter(hide parameters)
Upvotes: 2
Views: 17737
Reputation: 2563
You can't, it is not a Struts problem. It is how HTTP is designed. When a browser is redirected, it perform a GET
request. You cannot ask the browser to do a POST
instead. The only way would be to add some Javascript to send the request.
Or you can also ask Struts to do an internal redirection but it will be hidden to the client and the url will not change.
Upvotes: 8