Reply
How JSP call java function from class file
Old 05-26-2006, 02:54 AM How JSP call java function from class file
Junior Talker

Posts: 2
hi guys, i wanna know how JSP call and pass parameter to a java function from class file.


class file
-----------------------------------------
public double calcQty(double pPect, double tQty)
{
return (pPect * tQty / 100);
}
------------------------------------------

JSP file
-------------------------------------------
<jsp:useBean id = "pc" class="common.claim" scope="request" />
the following code is call the function from the class file
<%=pc.calcQty()%>

izzit correct or not?
if let say i wan to call the function at onClick, how to write the code?
if i wanna pass in parameter to that function, how to write?
plz someone help. thx
melvinoyh is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-31-2006, 02:19 PM Re: How JSP call java function from class file
Super Talker

Posts: 140
Quote:
Originally Posted by melvinoyh
hi guys, i wanna know how JSP call and pass parameter to a java function from class file.


class file
-----------------------------------------
public double calcQty(double pPect, double tQty)
{
return (pPect * tQty / 100);
}
------------------------------------------

JSP file
-------------------------------------------
<jsp:useBean id = "pc" class="common.claim" scope="request" />
the following code is call the function from the class file
<%=pc.calcQty()%>

izzit correct or not?
if let say i wan to call the function at onClick, how to write the code?
if i wanna pass in parameter to that function, how to write?
plz someone help. thx
JSP is not like JavaScript. JavaScript runs on client computer. But, JSP is running on web server. If event is not sending a request to server, you cannot assign calls to class from on click events.

You MUST send a request to the server using a link.
nvidura is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How JSP call java function from class file
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12000 seconds with 13 queries