Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 2
Trades: 0
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
 
 
Register now for full access!
Old 05-31-2006, 03:19 PM Re: How JSP call java function from class file
Super Talker

Posts: 140
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
nvidura is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How JSP call java function from class file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.35780 seconds with 12 queries