You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Gr...@ricoh.co.uk on 2010/02/10 10:21:35 UTC

struts 2.1.6 question

Hello,

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.

BookmarkAdd....

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


<action name="bookmarks!*" method="{1}"
 class="org.apache.roller.weblogger.ui.struts2.editor.Bookmarks">
            <result name="list" type="tiles">.Bookmarks</result>
            <result name="input" type="tiles">.Bookmarks</result>
        </action>

<action name="bookmarkAdd!*" method="{1}"
 class="org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd">
            <result name="input" type="tiles">.BookmarkAdd</result>
            <result name="success" type="chain">bookmarks</result>
            <result name="error" type="chain">bookmarks</result>
  </action>

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  postmaster@ricoh.co.uk . Please contact us on +44 (0) 208 261 4000 if you need assistance. 

Registered in England No: 473236 
VAT No: GB524161280