Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Action tag paramaeter

 
Ranch Hand
Posts: 53
MyEclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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 ?
 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
Message for you sir! I think it is a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic