• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ActionForms and html:link

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm creating links that forward to an Action that uses an ActionForm. I'm passing a Map to html:link to set the two or three request parameters. Should I be using the associated ActionForm instead of Map?
If so, how would I use the ActionForm to set the link's request parameters?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without knowing any more information of the project, I say stick with what you've got. That's what the name attribute is there for, after all.
 
Rick DeBay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My worry is the prevalence of "magic numbers." I describe this as any value that's defined in more than one place. If I use an ActionForm, the parameter names are in two places, the ActionForm class and struts-config.xml. Now with the Map, I have to use the correct parameter name there also. I guess I should use Dynamic Forms, so parameter names and types are only stored in the form's defining xml.
Comments?
 
author
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DynamicForms... Nah.. I know it is a matter of personal preference, but I always avoid them.
Here is something about Dynamic Forms you might want to check out:

ActionForm or DynaActionForm - Making the choice

Srikanth Shenoy
Author: Struts Survival Guide - Basics to Best Practices
reply
    Bookmark Topic Watch Topic
  • New Topic