File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Re: jsp:attribute usage within c:set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Re: jsp:attribute usage within c:set" Watch "Re: jsp:attribute usage within c:set" New topic

Re: jsp:attribute usage within c:set

Rina Magro
Ranch Hand

Joined: May 25, 2006
Posts: 63
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
Dagbj�rn Nogva

Joined: May 20, 2007
Posts: 10
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.

Rina Magro
Ranch Hand

Joined: May 25, 2006
Posts: 63
Thanks Dagbj�rn, that was what i call a spot on answer.
I agree. Here's the link:
subject: Re: jsp:attribute usage within c:set
Similar Threads
problem on c:set
"c:set target" but no scope?
c:set tag not clear
Error in c:set tag
How to Set HashMap in request attribute using JSTL Tag