tags:

views:

260

answers:

1

Hi

We are using Struts 2 Dispatcher Result to forward our request to some jsp page.

In struts.xml

<action name="sampleAction"
      class="com.mycomp.action.sampleAction">

      <result name="success" type="dispatcher">
      <param name="location">/jsp/success.jsp</param>
      </result>
      <result name="error">/jsp/error.jsp</result>
      <result name="input">/jsp/input.jsp</result>
</action>

Now we are able to see success.jsp but the request attributes we set are becoming null in

success.jsp

We used dispatcher because we need the same request to be forwarded so that the request attributes we set can be retrieved in success.jsp But it is not happening and we are getting nulls instead.

Is there anything which needs to be taken care?

Thank you Chaitanya

A: 

If I understand correctly, the issue is that request attributes are null in success.jsp after making two requests. You will need to place the attributes in the session or re-set the attributes in the action prior to forwarding to the success.jsp.

digitalsanctum
I edited the question. Please check now.
Chaitanya MSV