RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread Pani, Gourav
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
Subject: how to calculate A*B in jsp, where A and B are from
nested:write


A newbie question:
Currently I have
nested:write property='width'/
nested:write property='depth'/
I want to calculate the area IN JSP (not to modify ActionForm) as width X
depth.

I suppose I am going to use scriptlet.  How to achieve this?

Thanks.
Denis



-
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]




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread Sri Sankaran
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 Float(depth).floatValue();
  float a = w * d;
%

Sri

-Original Message-
From: Denis Wang [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 13, 2003 3:59 PM
To: Struts Users Mailing List
Subject: how to calculate A*B in jsp, where A and B are from nested:write


A newbie question:
Currently I have
nested:write property='width'/
nested:write property='depth'/
I want to calculate the area IN JSP (not to modify ActionForm) as width X depth.

I suppose I am going to use scriptlet.  How to achieve this?

Thanks.
Denis



-
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]




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread John Espey
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: Thursday, February 13, 2003 3:10 PM
 To: Struts Users Mailing List
 Subject: RE: how to calculate A*B in jsp, where A and B are from
 nested:write


 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 Float(depth).floatValue();
   float a = w * d;
 %

 Sri

 -Original Message-
 From: Denis Wang [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 13, 2003 3:59 PM
 To: Struts Users Mailing List
 Subject: how to calculate A*B in jsp, where A and B are from nested:write


 A newbie question:
 Currently I have
 nested:write property='width'/
 nested:write property='depth'/
 I want to calculate the area IN JSP (not to modify ActionForm) as
 width X depth.

 I suppose I am going to use scriptlet.  How to achieve this?

 Thanks.
 Denis



 -
 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]



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




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread Sri Sankaran
...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 calculate A*B in jsp, where A and B are from nested:write


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: Thursday, February 13, 2003 3:10 PM
 To: Struts Users Mailing List
 Subject: RE: how to calculate A*B in jsp, where A and B are from 
 nested:write


 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 Float(depth).floatValue();
   float a = w * d;
 %

 Sri

 -Original Message-
 From: Denis Wang [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 13, 2003 3:59 PM
 To: Struts Users Mailing List
 Subject: how to calculate A*B in jsp, where A and B are from 
 nested:write


 A newbie question:
 Currently I have
 nested:write property='width'/
 nested:write property='depth'/
 I want to calculate the area IN JSP (not to modify ActionForm) as 
 width X depth.

 I suppose I am going to use scriptlet.  How to achieve this?

 Thanks.
 Denis



 -
 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]



-
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]




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread John Espey
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, where A and B are from
 nested:write


 ...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 calculate A*B in jsp, where A and B are from
 nested:write


 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: Thursday, February 13, 2003 3:10 PM
  To: Struts Users Mailing List
  Subject: RE: how to calculate A*B in jsp, where A and B are from
  nested:write
 
 
  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 Float(depth).floatValue();
float a = w * d;
  %
 
  Sri
 
  -Original Message-
  From: Denis Wang [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, February 13, 2003 3:59 PM
  To: Struts Users Mailing List
  Subject: how to calculate A*B in jsp, where A and B are from
  nested:write
 
 
  A newbie question:
  Currently I have
  nested:write property='width'/
  nested:write property='depth'/
  I want to calculate the area IN JSP (not to modify ActionForm) as
  width X depth.
 
  I suppose I am going to use scriptlet.  How to achieve this?
 
  Thanks.
  Denis
 
 
 
  -
  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]
 


 -
 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]



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




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread Denis Wang
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 4:10 PM
To: Struts Users Mailing List
Subject: RE: how to calculate A*B in jsp, where A and B are from
nested:write


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 Float(depth).floatValue();
  float a = w * d;
%

Sri

-Original Message-
From: Denis Wang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 3:59 PM
To: Struts Users Mailing List
Subject: how to calculate A*B in jsp, where A and B are from nested:write


A newbie question:
Currently I have
nested:write property='width'/
nested:write property='depth'/
I want to calculate the area IN JSP (not to modify ActionForm) as width X
depth.

I suppose I am going to use scriptlet.  How to achieve this?

Thanks.
Denis



-
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]




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




RE: how to calculate A*B in jsp, where A and B are from nested:write

2003-02-13 Thread Denis Wang
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 Mailing List
Subject: RE: how to calculate A*B in jsp, where A and B are from
nested:write


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 Float(depth).floatValue();
  float a = w * d;
%

Sri

-Original Message-
From: Denis Wang [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 3:59 PM
To: Struts Users Mailing List
Subject: how to calculate A*B in jsp, where A and B are from nested:write


A newbie question:
Currently I have
nested:write property='width'/
nested:write property='depth'/
I want to calculate the area IN JSP (not to modify ActionForm) as width X
depth.

I suppose I am going to use scriptlet.  How to achieve this?

Thanks.
Denis



-
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]




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