struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Cooper" <...@maxcooper.com>
Subject Re: interpolated runtime values are forbidden?
Date Wed, 22 Jan 2003 08:58:57 GMT
I am not 100% sure this is the problem, but you generally can't use <%= %>
in an attribute value unless it is the whole thing.

Not okay:
<some:tag attribute="my favorite number is <%=i%>" />

Okay:
<some:tag attribute='<%= "my favorite number is " + i %>' />

<% String value = "my favorite number is " + i; %>
<some:tag attribute="<%=value%>" />

-Max

----- Original Message -----
From: "Michael Marrotte" <marrotte@nicusa.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Tuesday, January 21, 2003 10:13 PM
Subject: interpolated runtime values are forbidden?


> I'm using a map-backed form and get the following error:
>
> 500 Servlet Exception
> /tt-pay/pages/UnpaidCitations.jsp:20: interpolated runtime values are
> forbidden
> by the JSP spec at `payCitation(<%= unpaidCitation.getCitation() %>)'
>
>
> --------------------------------------------------------------------------
--
> ----
> Resin 2.1.4 (built Fri Aug 2 14:16:52 PDT 2002)
>
>
> With the following implementation:
>
> [ActionForm]
> ...
> public final class CheckoutForm extends ActionForm {
>   private HashMap payCitations = new HashMap();
>
>   public Object getPayCitation(String key) {
>     return (payCitations.get(key));
>   }
>
>   public void setPayCitation(String key, Object value){
>     payCitations.put(key, value);
>   }
> ...
>
> [JSP]
> ...
> <logic:iterate id="unpaidCitation" name="unpaidCitaions" >
> <tr>
>   <td>
>     <html:checkbox property="payCitation(<%= unpaidCitation.getCitation()
> %>)"/>
>     <bean:write name="unpaidCitation" property="citation" filter="true"/>
>   </td>
> ...
>
> Any ideas on what's wrong here or how to do this another way, with a Map
> (trying to stay away from idexes)?
>
> --Mike
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message