This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in getting from jsp in to Action

 
Naveen Mishra
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
just a simple doubt regarding getting parameter/attribute in action from jsp...


I'm using following line and getting data properly in my action class --
categoryName =request.getParameter("catName");

but not getting into action when using following line --
categoryName =request.getAttribute("catName");

Any logic/ reason or THUMB-RULE when to use getAttribute(...) and when getParameter(...)


Thanks .
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parameters are String values that are submitted (either on the URL or encoded in the post data). Attributes are objects of any type that your code, or the Struts framework, can attach to the request. You cannot add, edit or remove Parameters, but you can do this with Attributes.

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic