you could use a math taglib and do it without using scriptlets. i don't
know of one since we don't use any, but i am sure one would be available.
-Original Message-
From: Denis Wang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 3:59 PM
To: Struts Users Mailing List
There's probably a cute way of doing it with JSTL...somebody chime in, however, here's
how you could do it with Struts tags and scriptlet
nested:define
property=width
id=width/
nested:define
property=depth
id=depth/
%
float w = new Float(width).floatValue();
float d = new
I'm not familiar with the nested tags, but suppose you were using a
struts-el text tag, you could do like so: html:text value=${width *
depth}/
I'm guessing you can do something similar in the nested tags.
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent:
...ah! Much cleaner.
No, I don't think there's a nested-el
Sri
P.S.
I'm sure you meant html-el:text value=${width * depth}/
-Original Message-
From: John Espey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 4:13 PM
To: Struts Users Mailing List
Subject: RE: how to
sorry, left this part out:
%@ taglib uri=http://jakarta.apache.org/struts/tags-html-el; prefix=html
%
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 3:17 PM
To: Struts Users Mailing List
Subject: RE: how to calculate A*B in jsp,
Thanks for your reply. I believe this approach works. However I received
exceptions:
java.lang.ClassCastException: java.lang.Float...
I am looking at bean:define to dig the bug out.
Denis
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003
The approach resolves the problem. Just a tiny notice, type should be
defined.
nested:define
property=width
id=width type=java.lang.Float/
Thanks.
Denis
-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 4:10 PM
To: Struts Users
7 matches
Mail list logo