Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Re: jsp:attribute usage within c:set

 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
im testing usage of jsp:attribute within c:set.
Can somebody please tell me why the first code snippet works fine while the second code snipped gives me error:




Please help
thanks lots
Rina
 
Dagbj�rn Nogva
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rina,

According to the JSTL 1.2 spec, the valid formats of <c:set> are the following when used to set bean properties/map values:



As you can see, both target and property are required tag attributes. It is only the value attribute that alternatively can be specified by the tag body. Hence, your second code snippet is a violation of the spec.

Cheers,
Dagbj�rn
 
Rina Magro
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dagbj�rn, that was what i call a spot on answer.
regards
Rina
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic