This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes c:set in jstl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:set in jstl" Watch "c:set in jstl" New topic

c:set in jstl

sangeeta kapoor
Ranch Hand

Joined: Jun 15, 2004
Posts: 70
In <c:set var=... /> version if value is null the attribute is removed.
But what happens if the value is null in target version.
Colin Fletcher
Ranch Hand

Joined: Sep 10, 2004
Posts: 200
What does the spec say about c:set ?

SCJP 1.4 SCWCD 1.4
Durgaprasad Guduguntla
Ranch Hand

Joined: Oct 20, 2003
Posts: 99
Unlike var attribute the target attribute is used to set the values for existing java bean or a map. The target attribute in <c:set> tag should always evaluate to the real object. In case the target object is null, it will throw the exception on the Page. Please look at the following example:

JSP Page:

Exception thrown:



Thanks,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
I agree. Here's the link:
subject: c:set in jstl
It's not a secret anymore!