Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove and Set

 
satyam bobba
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:set var="a" value="b" />

<c:set var="${a}" value="c" />

<c:remove var="${a}"/>

In HFSJ book mentioned the var attribute remove tag should not be expression.

But i am not getting any error?

I tried in manner also<c:remove var="<%=a%>"/>

Can i use expression for <c:set> and <c:remove> for var attribute?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Which JSTL version you are using ? According to the JSTL 1.1 the "var" attribute of "set" tag does not accept the expressions. It is compilation time error.

Thanks
 
satyam bobba
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSTL 1.0 . What is the Latest version
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think the stable release is JSTL 1.1, which is also in Exam. The JSTL 1.2 is under Maintainence realease.

Thanks
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!