Solved

How to refer to a constant using JSTL

Posted on 2010-11-11
1
1,790 Views
Last Modified: 2012-05-10
I have a java constant defined as follows:
public static final String ACCESS_ROLE="accessRole".

In a struts action class I set this attribute in a session sesssion.setAttribute(Constants.ACCESS_ROLE, "adminrole");

In my JSP I am using JSTL. How could I use JSTL to check that the attribute exists in the session, i know how to do it using the actual string value such as

<c:if test="${(sessionScope.accessRole == 'true') }" > but how would I use Constant.ACCESS_ROLE in the if expression?
0
Comment
Question by:singh101
1 Comment
 
LVL 9

Accepted Solution

by:
ioanton earned 500 total points
ID: 34119685
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
thymeleaf natural templating vs JSP 2 166
jar file executable 12 62
ejb stateless example 2 44
glassfish admin console 1 23
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question