Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:set in jstl

 
sangeeta kapoor
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the spec say about c:set ?
 
Durgaprasad Guduguntla
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,

Durga
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic