Rocky
Rocky

Reputation: 161

how to access static boolean variable form jsp

Hi I have a class it contains a boolean value. I want to access its value in JSP page, if this value is false a link will show and if it true link will not show. I have also tried using getter method but it is not working, is there any way to this. My code is as below-

     public class Test { 
            public static boolean isMonitoringStarted;
        }

And in my JSP page I am trying this, but its not working -

        <c:if test="${!Test.isMonitoringStarted}" > 
             <a herf="#">Test</a>
        </c:if>

Please help me. Thanks in advance.

Upvotes: 1

Views: 1322

Answers (2)

LHA
LHA

Reputation: 9677

Check my solution ( Use Custom JSTL function ) Getting java.util.Calendar.YEAR in Spring message code

Upvotes: 1

jonasnas
jonasnas

Reputation: 3580

You could add isMonitoringStarted to request/session attribute and use ${isMonitoringStarted} in your jsp.

Upvotes: 0

Related Questions