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

use of attribute in action mapping?

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I want to know how attribute is used in action mapping,explain it with an example.
<action
path="/LoginSubmit"
type="actionservlet.GuestLoginAction"
name="GuestLoginForm"
scope="request"
validate="true"
parameter="MethodType"
attribute="" // how to use this one
/>

Thanks
[ April 03, 2007: Message edited by: sreenivas jeenor ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never use attribute in an action mapping, but here's what it does:

When you specify name="GuestLoginForm", you're associating the ActionForm named in the corresponding <form-bean> stanza as the form bean associated with this action, but you're also specifying that "GuestLoginForm" is the name that will be used when the form bean is placed in either request or session scope. (e.g. session.setAttribute("GuestLoginForm", theform); ). If for some unknown reason you don't want the name to be "GuestLoginForm", but "MyWonderfulForm" instead, you would specify attribute="MyWonderfulForm" in the action mapping. If you did this, any time you retrieved the actionform from either request or session scope, you would use the name "MyWonderfulForm" instead of "GuestLoginForm". If you don't specify an attribute, the name used defaults to whatever is specified as the name of the action.
[ April 03, 2007: Message edited by: Merrill Higginson ]
 
sreenivas jeenor
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Merrill

The clarification is great,you are Truly my GURU.
[ April 03, 2007: Message edited by: sreenivas jeenor ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic