You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Partha Sarathi Panda <pa...@gmail.com> on 2009/03/21 12:40:40 UTC

Query on Response code change from 200 to 302

Hi All,
  Hope you are doing well.

  I am building a application on struts when i hit an action it is giving me
a status code of 200 OK. As per my understanding when we receive a status
code as 200 most of the informations are saved in the cookie.I want to
receive a code of 302. As per my understanding if we get 302 response code
then the sensitive info are not stored in the cookie.

I did google and found some solution that, in stead of forewarding to a JSP
if i will forward it to an intermediate action then we will get 302 resp
code.Let me give an example

A basic action mapping giving 200 OK response.
<action
  path = "/com/google/Employee"
  type="......."
  name="....." >
<forward name="success" path="/com/google/jsp/home.jsp"/>

I changed the code as

<action
  path = "/com/google/Employee"
  type="......."
  name="....." >
<forward name="success" redirect="true" path="/com/google/home.do"/>

<action path="/com/login/home forward="/com/google/jsp/home.jsp"/>

Interestingly for the first action i am getting an action code 302. But now
i am getting 200 status code for com/login/home.do action.

Can anyone suggest me some idea for the changes.I will be more than happy to
get the suggestion..


Thanks a lot for your attention. Have a nice day.

Regards
Partha