This content has been marked as final.
Show 4 replies
-
1. Re: How to use constants in jsf pages ?
samdoyle Feb 24, 2010 1:50 PM (in response to narendra.narendra_00001.yahoo.co.in)@Name("appConstant")
@Scope(ScopeType.APPLICATION)
public class AppConstant {
...
}
value = #{appConstant.something}
One way, many ways of doing this, you could use a factory or managed component as well. -
2. Re: How to use constants in jsf pages ?
ssamayoagt Feb 24, 2010 4:26 PM (in response to narendra.narendra_00001.yahoo.co.in)"something" is
public static String getSomething(){...}
or
public static final String SOMETHING = ...
or
public static final String something = ...
or
what?
Thanks. -
3. Re: How to use constants in jsf pages ?
przemekc.pc83.tlen.pl Feb 25, 2010 12:17 PM (in response to narendra.narendra_00001.yahoo.co.in)JSF is using JavaBeans so you must do like this
@Name("appConstant")
@Scope(ScopeType.APPLICATION)
public class AppConstant {
private static final String something = "something value";
public String getSomething() {
return something;
}
}and now you have access to property something.
-
4. Re: How to use constants in jsf pages ?
przemekc.pc83.tlen.pl Feb 25, 2010 12:19 PM (in response to narendra.narendra_00001.yahoo.co.in)JSF is using JavaBeans so you must do like this
@Name("appConstant") @Scope(ScopeType.APPLICATION) public class AppConstant { private static final String something = "something value"; public String getSomething() { return something; } }
and now you have access to property something.