aspose file tools*
The moose likes Struts and the fly likes Action tag paramaeter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action tag paramaeter" Watch "Action tag paramaeter" New topic
Author

Action tag paramaeter

maganti suryanarayana
Ranch Hand

Joined: Mar 30, 2010
Posts: 53

<action name="create" class="createAction"
method="show">
<param name="showType">begin</param>
<interceptor-ref name="displayStack">
</interceptor-ref>
<result type="tiles">box.location.start
</result>
<result name="verificationRequired" type="redirect">/</result>
</action>
Hi, I am new to struts2 and unable to understand the above syntax. As per my idea i think createAction is the Action class where show is the method which returns the logic. I am unable to understand param name tag. One more thing is the result type is tiles what does it mean ? what is box.location.start and when result name="verificationRequired" "/" is the result and what does it mean ?


surya
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Maganti,

Show is the name of the method in action-class where you logic is written.Instead of execute which is default method you can use the other method name.
<param> is the parameter which you are passing for the action .Like we have servlet init parameters.

Interceptors are there to achieve common functionality in struts.
Result type tiles means you are using result type as tiles and for that you need to add separate configuration of tiles .
there are different Result types in struts

Regards
Jatan
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

i think createAction is the Action class where show is the method which returns the logic

Correct. In this case, it's likely the action is being defined as a Spring bean in a Spring configuration file.

That's a guess; I'm guessing that because the class name, createAction, does not follow any Java naming conventions (classes belong in a package, and class names should start with an uppercase letter). It is, however, a typical Spring bean name.

[...] the result type is tiles what does it mean?

It means the tiles plugin is being used. (Most likely. It could mean the developer has implemented their own "tiles" result type, but that would be a little unusual.

box.location.start is the name of the tile definition that will be rendered.

when result name="verificationRequired" "/" is the result and what does it mean?

This means when the action method returns the string verificationRequired the result rendered will be a redirect to the root of the application.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Action tag paramaeter