• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Query regarding Dispatch Action

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following mapping in the struts-config.xml:

<action parameter="method" path="/customerView" type="com.nucleus.web.app.customer.actions.CustomerViewAction">

<forward name="custDetails" path="/jsp/customer/CustomerDetails.jsp"/>
<forward name="custAddress" path="/jsp/customer/CustomerAddress.jsp"/>
<forward name="custLocalData" path="/jsp/customer/CustomerLocal.jsp"/>

</action>

As seen from the mapping,CustomerViewAction extends DispatchAction and the JSP pages such as CustomerDetails.jsp,CustomerAddress.jsp,etc. are all view JSP pages.

My question is that is it compulsory to give the name attribute as part of the action element os shown above?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name attribute is used by Struts to associate an action with an ActionForm. If you don't specify the name attribute, the ActionForm you receive as a parameter in the execute() method of your action class will be of type ActionForm, and will not be populated with any attributes. This is generally not what you want.
 
Shashidahanu Iyyanar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The action class will be used to display corresponding data from the database for the view JSP's.Data will be displayed in the JSP pages using Value Objects(VOs).Hence,is it required to specify a form name in case of view JSP's?Please reply to this as soon as possible.
Thanks in advance.
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic