Hi all,

I know this is more of a JSTL question but it would be really helpful
if anyone could help me understand the usage of c:out with Expression
Language (EL) which replaces the <bean:write />.

I believe Struts did not implement EL for <bean:write /> tag and few
others and suggests using <c:out /> instead.

I have a situation where I require to use dymanic textboxes based on
the certain criteria. To make this work I used LazyValidatorActionForm.
It works like a charm but when I want to write out certain form property
using EL, it doesn't work well. I am not sure how to use it with <c:out
/>. For example:

This is the code I tried to display a link with a value in the dynamic
form:

<c:forEach var="counter" begin="0" end="${numTextFields}" >
 .....
        <a href="<html-el:rewrite
page="/FAEditor.do"/>?methodToCall=removeElement&id=<c:out
value="${request['FAEditorForm'].id_${counter}}" />">Remove</a>
 .....
</c:forEach>

Here, I am trying to get the Form from the request attribute and invoke
the method for property 'id_?' where '?' can be some number depending on
the counter in the loop. When executing this page, I am getting an
exception:

javax.servlet.jsp.JspException: Can't insert page
'/pages/findingaids/FACustomContainerEditor.jsp' :
javax.servlet.jsp.JspException: The taglib validator rejected the page:
"tag = 'out' / attribute = 'value': An error occurred while parsing
custom action attribute "value" with value
"${request['FAEditorForm'].id_${counter}}": Encountered "{", expected
one of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=",
"ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and",
"&&", "or", "||"], "

I also tried using <c:set /> but looks like the JSTL tags does not
allow more than one '{' inside an attribute. Not sure how to solve this
issue. Any help is appreciated.

Thanks,
Srini

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

Reply via email to