• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL Question -Marcus Green

 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



will the below code is correct to print the "marcus" as ouput?
 
Deepak Chopra
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, It should..!
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it is correct
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
target value should be bean Object or Map object right ?
 
Deepak Chopra
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, you can see that employee is a bean object
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sunny,

in HFSJ 2nd edition , Chapter 9 -page no 456 says , "Don�t put the �id� name of the attribute here! "

can you please explain this.
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
deepa raj, what happened when you compiled the code?
 
Milind Patil
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried this code, it prints "marcus" as ouput.

About in HFSJ 2nd edition, Chapter 9 -page no 456 says , "Don�t put the �id� name of the attribute here! "

This means that don't use "id" name as a target directly. Instead use "id" name in a EL expression.
Use like this:
<c:set target="${employee}" property="firstName" value="marcus"/>

Don't Use like this:
<c:set target="employee" property="firstName" value="marcus"/>
This will throw ServletException...


[ August 21, 2008: Message edited by: Milind Patil ]
[ August 21, 2008: Message edited by: Milind Patil ]
 
deepa raj
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it :-)
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic