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 Web Component Certification (SCWCD/OCPJWCD) and the fly likes c:set 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:set" Watch "c:set" New topic


Ranjan Pwar

Joined: Dec 12, 2008
Posts: 13
with c:set we can use expression as value of value attribute but when i try this it is showing exception:
( Attribute value application.getAttribute("userLevel") is quoted with " which must be escaped when used within the value)

<c:set var="userLevel" scope="session" value="<%= application.getAttribute("userLevel") %>" />
Kathiresan Chinna
Ranch Hand

Joined: Aug 17, 2008
Posts: 115

you can use EL

or try this
<c:set var="userLevel" scope="session" value="<%= application.getAttribute(\"userLevel\") %>" />

It is sorta covered in the JavaRanch Style Guide.
subject: c:set
It's not a secret anymore!