This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSP and the fly likes <c:set > - Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "<c:set > - Doubt" Watch "<c:set > - Doubt" New topic

<c:set > - Doubt

Dinesh Andavar

Joined: Jun 29, 2013
Posts: 12
I read that when setting attributes using <c:set var ="attributeName" value = "attributeValue"> it deletes the attribute if the value is NULL.
My question is if i donot give a scope it first looks in the page Scope. Assume the attributeValue is NULL. It deletes the attribute from the Page Scope
What about other scopes. What will it do if there are attributes with same name in other scopes like request, session and application?
Will they be deleted too??
K. Tsang

Joined: Sep 13, 2007
Posts: 3059

To my understanding, the <c:set> tag default scope is "page". There is a scope attribute. Unless you specific this attribute, you are only accessing the page scope's variables.

K. Tsang JavaRanch SCJP5 SCJD OCPJP7 OCPWCD5 OCPBCD5 OCPWSD5 OCMJEA5 part 1 part 2/3
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

What does the JSTL Specification have to say on the matter?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: <c:set > - Doubt
It's not a secret anymore!