You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul McCulloch <pa...@axiossystems.com> on 2004/01/26 18:56:00 UTC

[OT] How to use java constants as bean identifiers in jsps

Hi,

Is there a common solution to using Constants for bean identifiers in your
views?

For example in some action I have
...
Collection foo = new SomeCollection();
request.setAttribute(Constants.SOME_THING, foo);
....

I want to access this collection via the JSTL in my view. Something like

<c:forEach items=${Constants.SOME_THING} var="thing">
	<c:out value="thing.name"/>
</c:forEach>

Is there a decent way of doing this? What does everyone else do? 

thanks,

Paul


**************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code.  You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [OT] How to use java constants as bean identifiers in jsps

Posted by James Mitchell <jm...@apache.org>.
Look at the "unstandard" tags.  Specifically, the bind tag.


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017 (cell)
AIM: jmitchtx
MSN: jmitchell@apache.org



----- Original Message -----
From: "Paul McCulloch" <pa...@axiossystems.com>
To: "Struts Users Mailing List (E-mail)" <st...@jakarta.apache.org>
Sent: Monday, January 26, 2004 12:56 PM
Subject: [OT] How to use java constants as bean identifiers in jsps


> Hi,
>
> Is there a common solution to using Constants for bean identifiers in your
> views?
>
> For example in some action I have
> ...
> Collection foo = new SomeCollection();
> request.setAttribute(Constants.SOME_THING, foo);
> ....
>
> I want to access this collection via the JSTL in my view. Something like
>
> <c:forEach items=${Constants.SOME_THING} var="thing">
> <c:out value="thing.name"/>
> </c:forEach>
>
> Is there a decent way of doing this? What does everyone else do?
>
> thanks,
>
> Paul
>
>
> **************************************
> Axios Email Confidentiality Footer
> Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such case, you should destroy this message, and notify
us immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
> WARNING:
> While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code.  You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail.  Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org