Hi "JS Portal Support",
I did something you intend last year. I put all my application wide constants
in a single "Constants" class.
I used a ServletContextListener to put all the fields via introspection in a
Map in the application scope using the key "Constants".
public void contextInitialized(ServletContextEvent event) {
This way I could access all my constants in the JSPs via JSF expression:
<c:if test="${globalView.linieTab eq Constants.TAB_DETAILS}">
alternatively to the "normal" syntax
----- Original Message -----
From: JS Portal Support
[mailto:[EMAIL PROTECTED]
To: [email protected]
Sent: Mon, 25 Sep
2006 13:20:13 +0200
Subject: How to reference a static value in JSF
> Hi,
>
> Just started to implement Shale and JSF. As I've always worked more with
> scriptlets and Servlets I can't seem to figure out how to reference a public
> static value from one of my classes in my JSP's. I've always used:
>
> <input type="hidden" name="a"
> value="<%=com.jsportal.projectportal.web.webActions.login%>"/>
>
> Now I try to achieve this with the following:
>
> <h:inputHidden id="a"
> value="${com.jsportal.projectportal.web.webActions.login}"/>
>
> I understand this doesn't work as it will try to call
> com.getJsportal()....etc. But how do I do it, as the <%=%> is not allowed in
> these taglib tags?
>
> Thanks,
> Joost
>
>