struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toni Lyytikäinen" <>
Subject How to pass messages that survive redirects?
Date Fri, 29 Jun 2007 14:09:48 GMT
I've used to doing something like this in Ruby on Rails:

if @object.updateAttributes(params[:object])
    flash[:notice]="Update succesful!"
    redirect_to :action=>'list'
else ...

Now that I'm using Struts 2 for a project I tried doing something similar:

try {;
    addActionMessage("Update succesful!");
    return "redirect";
} catch (...)

But I found out that the actionmessages don't show in the redirected action
anymore (probably because then it's another instance of that class that
doesn't have the same actionmessages property), even though I have the
<s:actionmessage />-tag. Is there a mechanism to pass messages from actions
that survive a redirect? Or should I just put them into the users session?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message