Well, for whatever reason, this seemed kind of entertaining (sad, huh?) so I
fleshed it out a bit and actually gave it a test run. Since both JSTL and Struts
taglibs can deal with a Map (JSTL doesn't have a clue about DynaBeans), that
seemed like a better way to go. So, the reflection can be done b
Sounds like a job for a beanutils mechanism that does something like
(untested):
Class clazz = GLOBALS.class;
String className = clazz.getName();
Map propMap = new HashMap();
List dynaProps = new ArrayList();
Field[] allFields = clazz.getDeclaredFields();
for (int i = 0, n = allFields.length; i
As long as we're experimenting here :) , you could even have a method
that takes a hashmap and a class, and uses reflection to load up all the
"static final int" constants into the hashmap.
> -Original Message-
> From: Karr, David [mailto:[EMAIL PROTECTED]]
>
> It's a little more verbose,
m wrote:
>
> > Date: Wed, 20 Nov 2002 15:02:22 -0700
> > From: David Graham <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Re: JSTL Question (EL vs. RT + Struts)
> >
> >
On Wed, 20 Nov 2002, David Graham wrote:
> Date: Wed, 20 Nov 2002 15:02:22 -0700
> From: David Graham <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: JSTL Question (EL vs. RT + Struts)
>
> But
... but can you even do that? Can you use class-static methods without
an instance of the class?
I've toyed with the idea of adding getters for constants into the
Globals class, and then placing an instance of that class into
application-scope. What name should a person use though? If you us
>>> But what is the EL expression to get a constant like Constants.MY_KEY?
>>There is none. JavaBeans. JavaBeans. JavaBeans.
> I see, so I have to do constants.getMyKey(). I guess that's easy enough.
What about ?
--
Wendy
20, 2002 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: RE: JSTL Question (EL vs. RT + Struts)
>
> I see, so I have to do constants.getMyKey(). I guess that's
> easy enough.
>
> David
>
> >From: "Karr, David" <[EMAIL PROTECTED]>
> >
> >The
I see, so I have to do constants.getMyKey(). I guess that's easy enough.
David
From: "Karr, David" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subj
L PROTECTED]>
> >
> >On Wed, 20 Nov 2002, Hohlen, John wrote:
> >
> > > Date: Wed, 20 Nov 2002 13:14:43 -0600
> > > From: "Hohlen, John" <[EMAIL PROTECTED]>
> > > Reply-To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
>
But what is the EL expression to get a constant like Constants.MY_KEY?
David
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: JSTL Q
On Wed, 20 Nov 2002, Hohlen, John wrote:
> Date: Wed, 20 Nov 2002 13:14:43 -0600
> From: "Hohlen, John" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "Struts-Help (E-mail)" <[EMAIL PROTECTED]>
> Subje
Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts-Help (E-mail)" <[EMAIL PROTECTED]>
> >Subject: JSTL Question (EL vs. RT + Struts)
> >Date: Wed, 20 Nov 2002 13:14:43 -0600
> >
> >My team is starting a new project with Struts. In our p
spond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>
To:[EMAIL PROTECTED]
cc:
Subject: Re: JSTL Question (EL vs. RT + Struts)
You should use the JSTL EL library because of the expression language's
power. These tags replace most of the logic and bean tag
solved it myself.
David
From: "Hohlen, John" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts-Help (E-mail)" <[EMAIL PROTECTED]>
Subject: JSTL Question (EL vs. RT + Struts)
Date: Wed, 20 Nov 2002 13:14:43 -06
My team is starting a new project with Struts. In our previous Struts
projects, our JSPs used mostly tags from the Struts tag libraries. For our
new project, I want my team to start using the JSTL. For that reason, the
"Struts-EL" subproject is very appealing because it will force our
developers
16 matches
Mail list logo