On 8/28/06, Mead, Robert F (Titan) @ TITAN <[EMAIL PROTECTED]> wrote:

<logic:equal value="someValue" name="${param.formName}" property="someProp">

The Struts libraries are intelligent enough to take a dynamic form name and 
find the property.

I have not been able to get the same behavior to work using JSTL and EL.
For example the following fails (and I've tried a bunch of other guesses to no 
avail):
<c:if test="${param.formName.someProp}"> gives "unable to find value for someProp in 
object String"

Is there a way to get the same functionality without using the Struts tags?

The first issue I see is that you need to find the form itself, using
'param.formName' as the key into the session or request map.  I think
you're going to have to know where the form is stored for this to
work.

Then you need to get the property out of the form.  You said it's a
dynamic form, so you'll need to go through the form's 'map' property
to do that.

Try something like this:

 <c: if test="${session[param.formName].map.someProp}" >

You may want to split it up with a <c:set>, to make it more readable.

Now someone will probably point out that I'm making it far more
complicated than it needs to be. :)

--
Wendy

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

Reply via email to