I tried this: <c:if test='${empty form.mappedProperty["13"]}'>
And received the error below. I know that there is a getMappedProperty(String key) method on the form class. Any other ideas? I can't believe this isn't working right -- there's got to be a way to pass parameters into methods usting JSTL. Any other ideas?? javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "test" with value "${empty form.mappedProperty["13"]}": Unable to find a value for "mappedProperty" in object of class "com.myApp.MyForm" using operator "." -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 8:22 AM To: Struts Users Mailing List Subject: Re: Map-backed action forms with JSTL tags "Asleson, Ryan" <[EMAIL PROTECTED]> wrote on 10/20/2004 08:18:48 AM: > > [This question was posted to taglib-user list also but I received no > responses. My apologies for the cross post.] > > Hello, > > I have the following JSTL code fragment that is failing: > > > <c:if test="${empty form.mappedProperty[13]}"> > <c:set target="${form}" property="mappedProperty[13]" value="newValue"/> > </c:if> > Based on page 347 of JSTL in action try this... <c:if test='${empty form.mappedProperty["13"]}'> > > The "form" object has a method called getMappedProperty that takes a String > as the key and returns the appropriate value. There is also a > setMappedProperty method that takes two Strings as parameters, the key and > new value, and sets the value. > > Basically, in this instance I want the 13 to be passed to the > getMappedProperty method as a String parameter, just like Struts tags allow > when using parentheses in property value attributes. > > This code is failing to compile -- at least, if fails on the c:if line. I'm > trying to get this to work the way the Struts tags do, where any values that > appear in parentheses are assumed to be parameters to the underlying bean > property method. > > How can I modify the above code so it does as I desire? I figure it has to > be close. > > > Thank you!!! > > > > This e-mail message is being sent solely for use by the intended > recipient(s) and may contain confidential information. Any > unauthorized review, use, disclosure or distribution is prohibited. > If you are not the intended recipient, please contact the sender by > phone or reply by e-mail, delete the original message and destroy > all copies. Thank you. > > --------------------------------------------------------------------- > 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] This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]