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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, September 10, 2003 9:38 AM
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to