[Logo]
Forums Register Login
Session Management using URL rewriting in Struts
hi,
In our application being developed using struts, we need to handle session using URL rewriting(client requirement). I tried to put the following in struts-config.xml
<action path="/SearchConditionList"
type="com.jp.nissan.nshop.WRN.action.SearchCriteriaAction"
name="SearchCriteriaActionForm"
validate="true"
input="/searchanddownload/IntroductionSearchFailureError.jsp"
scope="session">
<forward contextRelative="true" redirect="true" name="SearchListOffice" path="../searchanddownload/SearchFrame.jsp"/>
</action>
in forward tag i mentioned redirect="true" so that response.sendRedirect gets invoked and URL rewriting happens, but session is not retained still.
Thanks in advance.
Best Regards,
Satheesh
Hello All,


Iam also facing similar kind of problem while testing my application.( I disabled my browser cookies settings so that browser relies only url rewriting)


(Everthing works fine when i enable cookies in th browser)


<action path="/sourceAction"
type="com.test.action.SourceAction"
name="someForm"
validate="true"
>

<forward name="success" path="/targetAction.do?parameter=init"/>

</action>


<action path="/targetAction"
type="com.test.action.TargetDispatchAction"
name="someForm2"
validate="true"
parameter="parameter"
>


From SourceAction's execute method iam doing the following before forwarding to targetAction.

-----------
-----------

ActionForward forward = mapping.findForward("success");

ActionForward urlEncodedForward = new ActionForward(response.encodeURL(forward.getPath()));

return urlEncodedForward;

-------------


Even after doing this the TargetAction is not part of my session.
session is lost.

session.isNew() returns true in TargetAction's init() method.

Please provide your valuable suggestions. Thanks a lot for your time.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Nov 24, 2017 00:55:05.