You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Erez Efrati <er...@netmedia.net.il> on 2003/05/28 03:43:56 UTC
what is wrong here?
I keep getting errors on the following: (I am using 1.1 beta 3)
<bean:define id="col" value='<%= 6 / 4 + 1 %>' />
Can someone tell me what is wrong here?
Thanks,
Erez
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: what is wrong here?
Posted by Mark Galbreath <ma...@qat.com>.
Ah f*ck...I've been working 16 hours straight and no end in site; got a
deadline to meet in the AM. I'll review this tomorrow.
Mark
-----Original Message-----
From: Steve Raeburn [mailto:steve@ninsky.com]
Sent: Tuesday, May 27, 2003 11:41 PM
To: Struts Users Mailing List
Subject: RE: what is wrong here?
That's not true. 'System.out.println(6 / 4 + 1 );' outputs 2, as does <%= 6
/ 4 + 1 %>. It just doesn't work when it's nested like that.
Steve
> -----Original Message-----
> From: Mark Galbreath [mailto:mark_galbreath@qat.com]
> Sent: May 27, 2003 8:13 PM
> To: 'Struts Users Mailing List'; steve@ninsky.com
> Subject: RE: what is wrong here?
>
>
> Well, for one thing, review your JSP. <%= xxx %> is a synonym for
> "out.println." It cannot render calculations at runtime. You have to
> have a function to do that, like <%= calculate( 6/4+1 ) %>.
>
> Mark
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: what is wrong here?
Posted by Steve Raeburn <st...@ninsky.com>.
That's not true. 'System.out.println(6 / 4 + 1 );' outputs 2, as does <%= 6
/ 4 + 1 %>.
It just doesn't work when it's nested like that.
Steve
> -----Original Message-----
> From: Mark Galbreath [mailto:mark_galbreath@qat.com]
> Sent: May 27, 2003 8:13 PM
> To: 'Struts Users Mailing List'; steve@ninsky.com
> Subject: RE: what is wrong here?
>
>
> Well, for one thing, review your JSP. <%= xxx %> is a synonym for
> "out.println." It cannot render calculations at runtime. You
> have to have
> a function to do that, like <%= calculate( 6/4+1 ) %>.
>
> Mark
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: what is wrong here?
Posted by Mark Galbreath <ma...@qat.com>.
Well, for one thing, review your JSP. <%= xxx %> is a synonym for
"out.println." It cannot render calculations at runtime. You have to have
a function to do that, like <%= calculate( 6/4+1 ) %>.
Mark
> -----Original Message-----
> From: Erez Efrati [mailto:ereze@netmedia.net.il]
> Sent: May 27, 2003 6:44 PM
> To: 'Struts Users Mailing List'
> Subject: what is wrong here?
>
>
>
> I keep getting errors on the following: (I am using 1.1 beta 3)
>
> <bean:define id="col" value='<%= 6 / 4 + 1 %>' />
>
> Can someone tell me what is wrong here?
> Thanks,
> Erez
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: what is wrong here?
Posted by Steve Raeburn <st...@ninsky.com>.
I vaguely remember something about the JSP processor not converting to a
String when you use an expression inside a tag like that. Someone els emay
have the details. Anyway this works:
<bean:define id="col" value='<%= Integer.toString(6 / 4 + 1) %>' />
Steve
> -----Original Message-----
> From: Erez Efrati [mailto:ereze@netmedia.net.il]
> Sent: May 27, 2003 6:44 PM
> To: 'Struts Users Mailing List'
> Subject: what is wrong here?
>
>
>
> I keep getting errors on the following: (I am using 1.1 beta 3)
>
> <bean:define id="col" value='<%= 6 / 4 + 1 %>' />
>
> Can someone tell me what is wrong here?
> Thanks,
> Erez
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org