struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Néstor Boscán <nestor.bos...@tcs.com.ve>
Subject RE: Using JSTL to access form bean properties
Date Sun, 14 Aug 2005 20:38:39 GMT
Thanks Robert 

-----Mensaje original-----
De: Robert Taylor [mailto:64rwtaylor05@bellsouth.net] 
Enviado el: Sunday, August 14, 2005 2:18 PM
Para: Struts Users Mailing List
Asunto: Re: Using JSTL to access form bean properties

Your form bean should be in either request or session scope under the name
used to define it in struts-config.xml file. What I usually do is something
like the following:

<c:set var="form" value="${myform}"/>


and then you can use it like any other object with c:if or c:choose.

<c:choose>
<c:when test="${form.someBooleanProperty}">

</c:when>
<c:otherwise>

</c:otherwise>
</c:choose>


Even though the form bean is already defined in some scope, I redefine it at
the top of the page to avoid having to make multiple reference changes if my
form name happens to change. If it does, I only change it in one place.

/robert

Néstor Boscán wrote:
> Hi
> 
> Has anybody used JSTL to access form bean properties. I'm using JSTL 
> and Struts Tags and I would like to do some conditioning using <c:if> 
> and <c:choose> using the form bean properties.
> 
> Regards,
> 
> Néstor Boscán
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 


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




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


Mime
View raw message