How JSP call java function from class file

Discussion in 'JavaScript' started by melvinoyh, May 25, 2006.

  1. #1
    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, May 25, 2006 IP