roller-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject struts 2.1.6 question
Date Wed, 10 Feb 2010 09:21:35 GMT

I have a general question on struts 2.1.6.

I have noticed that when an action adds an error message and then chains 
to another action it does not call the execute(). 

eg   BookmarkAdd.  If there is an error in the execute if(getFolder() == 
null)  it adds an error message and then returns ERROR which in turn 
chains to bookmarks.  It then displays the error message but does not call 
the execute (it does call the myprepare() however) showing an empty list.

Has anyone else seen this?

Also, I have had to add the <result name="input" 
type="tiles">.Bookmarks</result> otherwise no result INPUT error is shown.


    public String execute() {
        if(getFolder() == null) {
            // TODO: i18n
            addError("Cannot add bookmark to null folder");
            return ERROR;
        return INPUT;

<action name="bookmarks!*" method="{1}"
            <result name="list" type="tiles">.Bookmarks</result>
            <result name="input" type="tiles">.Bookmarks</result>

<action name="bookmarkAdd!*" method="{1}"
            <result name="input" type="tiles">.BookmarkAdd</result>
            <result name="success" type="chain">bookmarks</result>
            <result name="error" type="chain">bookmarks</result>

Cheers Greg

Share our environment commitment - conserve resources and contribute to the reduction of CO2
emissions by not printing the email unless absolutely necessary to do so. 

Any opinions expressed are those of the author, not Ricoh UK Ltd. This communication does
not constitute either offer or acceptance of any contractually binding agreement. Such offer
or acceptance must be communicated in writing. It is the responsibility of the recipient to
ensure this email and attachments are free from computer viruses before use and the sender
accepts no responsibility or liability for any such computer viruses. 

Ricoh UK Ltd. may monitor the content of emails sent and received via its network for the
purpose of ensuring compliance with its policies and procedures. This communication contains
information, which may be confidential or privileged. The information is intended solely for
the use of the individual or entity named above. If you are not the intended recipient, be
aware that any disclosure, copying, distribution or use of the contents of this information
is prohibited. If you have received this communication in error, please notify the sender
immediately by return email with a copy to . Please contact us on
+44 (0) 208 261 4000 if you need assistance. 

Registered in England No: 473236 
VAT No: GB524161280  
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message