• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

can we able to define an action class without formbean

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
can we able to define an action class without formbean class

i.e.,in action mapping tag , without name attribute

please explain it

thanks in advance
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi sivakumar,
You may use DynaActionForm for that. Here you will need to define it in the struts-config.xml file instead of creating a java class for the same. The foll links will help you.
1) http://www.roseindia.net/struts/DynaActionForm.shtml
2) http://struts.apache.org/1.x/struts-core/apidocs/org/apache/struts/action/DynaActionForm.html
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can define an Action maapping without a name attribute, which means it has no reference to an ActionForm. If you do so, null will be passed to the execute method as the ActionForm parameter when the method is called by Struts.

However you cannot use such an action in an <html:form> tag. Any Action referenced in this tag must have an ActionForm bean attached. Whether it's a DynaActionForm as described by Roshani or a regular ActionForm doesn't matter, but you must define one.
 
I found some pretty shells, some sea glass and this lovely tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic