tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <David.K...@wamu.net>
Subject RE: Can EL take variables?
Date Wed, 10 Sep 2003 16:46:46 GMT
One way to get indirection is to use the fact that the several variable
scopes are all hashmaps available to the EL.  So, if you have a variable
named "formName" that contains the name of a variable you want to
reference, you can reference "pageScope[formName]" to reference that
variable. If you use this technique, you have to know what scope the
variable is in (page, request, session, or application).

> -----Original Message-----
> From: billy.bacon@thirty3.net [mailto:billy.bacon@thirty3.net] 
> Sent: Wednesday, September 10, 2003 9:38 AM
> To: taglibs-user@jakarta.apache.org
> Subject: Can EL take variables?
> 
> 
> I'm hoping there is a way to do this but I haven't
> figured it out yet...
> 
> I have a DynaActionForm but the form name is a variable
> since the user could be coming from two different
> sections and I'm trying to utilize one page to handle
> either request...
> 
> So I have a <c:set> tag that defines the formName like
> so...
> 
> <c:set var="formName" value="${formName}"/>
> 
> but when I try to use this in my conditional
> statements, EL is treating formName as a string and not
> a form....
> 
> <c:if test="${formName.map.xxxx}">
> <%-- Whatever --%>
> </c:if>
> 
> I'm getting a compilation error. 'formName' should be
> translated to the actual form bean name such as
> 'kmoCreateComplexForm' or 'kmoCreateSimpleForm'
> depending on where the user is coming from.
> 
> Is there a way to do this? What am I doing wrong?
> 
> - Billy -
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> 
> 

Mime
View raw message