struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Siggelkow <>
Subject Re: mapping values in jsp
Date Wed, 02 Feb 2005 16:03:02 GMT
Abdullah Jibaly wrote:
> Hi all,
> Has anyone come across a good way to solve this issue using jstl? I want a clean way
to map values and being able to define it within the jsp page. for example, if a bean property
has a value of true, I want to get the output as 'Yes'.
> <c:out value="${isEnabled}" /> -> outputs true or false
> I know you can use a map, but is there a way to cleanly define it in the jsp page? If
not what is the recommended way of doing it?
> <c:out value="${yesNoMap[isEnabled]}" /> -> outputs yes or no
> Thanks in advance,
> Abdullah

A straightforward approach would be ...

<c:if test="${enabled}">Yes</c:if>
<c:if test="${not enabled}">No</c:if>

-Bill Siggelkow

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message