You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/09/18 01:50:19 UTC
Confused - Scaffold and Action Mapping
I have problem to understand the action mapping shown
below:
code:
-----------------------------------------------------
<action path="/Menu" name="menuForm"
type="org.apache.struts.scaffold.ExistsAttributeAction"
parameter="application;HOURS">
<forward name="success" path=".article.Menu"/>
<forward name="failure" path="/do/MenuCreate"/>
</action>
-----------------------------------------------------
It looks to me that
1. menuForm is the logical name for the form bean as
given in the form-bean segment of the
struts-config.xml file.
Question 1: What is the rational of having 'menuForm'
in the org.apache.struts.scaffold folder in
ActionMapping?
2. the action that is going to be executed is
the ExistsAttributeAction in the
org.apache.struts.scaffold folder. If the
condition returned in that action is 'success', the
article.Menu tile will render the next page.
The code of ExistsAttributeAction.java shows:
mapping.findForward(Tokens.SUCCESS);
Question 2: Where can I find Tokens.SUCCESS maps to
'success'?
Thank you for your help.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Confused - Scaffold and Action Mapping
Posted by Ted Husted <hu...@apache.org>.
1. The .article.Menu tile uses the menuForm bean.
2. Check the import statement at the top of the file =:0) It's just a
static String.
HTH, Ted.
Caroline Jen wrote:
> I have problem to understand the action mapping shown
> below:
>
> code:
> -----------------------------------------------------
>
> <action path="/Menu" name="menuForm"
> type="org.apache.struts.scaffold.ExistsAttributeAction"
> parameter="application;HOURS">
> <forward name="success" path=".article.Menu"/>
> <forward name="failure" path="/do/MenuCreate"/>
> </action>
>
> -----------------------------------------------------
>
> It looks to me that
>
> 1. menuForm is the logical name for the form bean as
> given in the form-bean segment of the
> struts-config.xml file.
>
> Question 1: What is the rational of having 'menuForm'
> in the org.apache.struts.scaffold folder in
> ActionMapping?
>
> 2. the action that is going to be executed is
> the ExistsAttributeAction in the
> org.apache.struts.scaffold folder. If the
> condition returned in that action is 'success', the
>
> article.Menu tile will render the next page.
>
> The code of ExistsAttributeAction.java shows:
>
> mapping.findForward(Tokens.SUCCESS);
>
> Question 2: Where can I find Tokens.SUCCESS maps to
> 'success'?
>
> Thank you for your help.
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
Ted Husted,
Junit in Action - <http://www.manning.com/massol/>,
Struts in Action - <http://husted.com/struts/book.html>,
JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org