Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 61499 invoked from network); 24 Nov 2009 23:31:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Nov 2009 23:31:04 -0000 Received: (qmail 52773 invoked by uid 500); 24 Nov 2009 23:31:02 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 52684 invoked by uid 500); 24 Nov 2009 23:31:01 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 52674 invoked by uid 99); 24 Nov 2009 23:31:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 23:31:01 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [206.108.156.36] (HELO gatekeeper.x.proship.com) (206.108.156.36) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2009 23:30:51 +0000 Received: from [192.168.0.90] (unknown [192.168.0.90]) by gatekeeper.x.proship.com (Postfix) with ESMTP id E60E22F871 for ; Tue, 24 Nov 2009 18:30:29 -0500 (EST) Message-ID: <4B0C6C94.7060804@proship.com> Date: Tue, 24 Nov 2009 18:30:28 -0500 From: Daniil Barklon User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: MyFaces Discussion Subject: Re: How do you access public static final values in your JSF app? References: <26504910.post@talk.nabble.com> <8f985b960911241511w7ce87389qe60de513c58c1493@mail.gmail.com> In-Reply-To: <8f985b960911241511w7ce87389qe60de513c58c1493@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org If you use Spring, you can use a FieldRetrievingFactoryBean to expose your constants as beans. http://static.springsource.org/spring/docs/2.5.6/api/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.html Mike Kienenberger wrote: > More often than not, I use an accessor on the backing bean. > > public String getSomeConstant() > { > return SOME_CONSTANT; > } > > #{someBean.someConstant} > > On Tue, Nov 24, 2009 at 6:07 PM, laredotornado wrote: >> Hi, >> >> I'm using MyFaces 1.1.6 and Tomahawk 1.1.9. I have a public static final >> int constant in a certain class, and I would like to be able to access that >> value in my JSF page using JSF code. I was curious what mechanisms you sue >> to do that. >> >> The only informative article I found on the subject is here -- >> http://java_rzanner.blogspot.com/2006/09/usage-of-constant-values-in-jsp-code.html, >> which discusses creating a map of constants and putting them into the >> application scope via a ServletContextListener. If you know of a more >> straightforward way, please let me know. >> >> Thanks, - Dave >> >> -- >> View this message in context: http://old.nabble.com/How-do-you-access-public-static-final-values-in-your-JSF-app--tp26504910p26504910.html >> Sent from the MyFaces - Users mailing list archive at Nabble.com. >> >> > -- Daniel Barklon Proship Entertainment, Inc. Tel:514.485.8823 ext.224 Fax:514.485.2675 Web: http://www.proship.com 980 St. Antoine Street West, Suite #710 Montreal, Quebec, Canada H3C 1A8