• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forward result from S2 to S1?

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to display an action message once a S2 action completes and result is redirected to S1 action. I dont see the message on the result page, however, when I visit any page in my application which belongs to S2 then this result message shows up there. I know why this is happenings but how do i fix this?

Thanks.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't state anything about how you're trying to accomplish this, so it's impossible to help.
 
Nick Sher
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:You don't state anything about how you're trying to accomplish this, so it's impossible to help.



Hmm, that's true.

This is what I am trying to do. So far I have, S2 action defined in struts.xml as

S1 action is defined in struts-config.xml.

Is there anyway I can copy the S2 action message to an S1 action message?
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I don't know Struts 1 and how it handles action messages, so I don't know if it's directly possible. If no one comes up with a better solution, you might want to consider simply passing the actionmessages from S2 as a collection to your S1 action and then deal with them there.

Make sure that your S2 action is extending ActionSupport as that exposes a getActionMessages() method. Then try configuring your S2 action as


and make sure that you have a in your S1 action.

Regards

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should just put it in the session.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friend,

<action name="dis" class="Ron.FirstAction">
<result name="yes" type="dispatcher">/success.jsp </result>
</action>
this result goes to jsp page with request.

<action name="chn" class="Ron.SecondAction">
<result name="yes" type="chain">dis</result>
</action>
this result chaning with prevoius reqest to new request bur it goes to next action.

<action name="red" class="Ron.FirstAction">
<result name="yes" type="redirect">/success.jsp</result>
</action>
this result rederect to the next jsp page.

<action name="reda" class="Ron.SecondAction">
<result name="yes" type="redirect-action">dis</result>
</action>
this result goese to next action but destroying first requst and generating new request
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic