simonTheTraveller
Programmer
Hi all. I'm trying to call a jsp function from a jsp page. The jsp function resides inside a class held in another location. At the top of the jsp page i've used the line:
<jsp:useBean id="liSummary" scope="session" class="mm.mmLifeInsSummary"></jsp:useBean>
to instantiate the class and be called liSummary
inside liSummary is a function called calcNeededLi
this looks like this:
public double calcNeededLi(int term,double income){
double factors[] = {0.0,0.0,0.0,0.0,0.0,4.5,5.28,6.03,6.76,7.44,8.1};
double theFactor = factors[term];
double neededLi = theFactor * income;
return neededLi;
}
from the main jsp page I'm trying to call the function but with no luck using the following line:
liSummary.calcNeededLi((Integer)session.getAttribute("value1"),(Double)session.getAttribute("value2
"))
however, this outputs the error message:
java.lang.ClassCastException: java.lang.String
Anybody have any idea why? Thanks (in advance)
<jsp:useBean id="liSummary" scope="session" class="mm.mmLifeInsSummary"></jsp:useBean>
to instantiate the class and be called liSummary
inside liSummary is a function called calcNeededLi
this looks like this:
public double calcNeededLi(int term,double income){
double factors[] = {0.0,0.0,0.0,0.0,0.0,4.5,5.28,6.03,6.76,7.44,8.1};
double theFactor = factors[term];
double neededLi = theFactor * income;
return neededLi;
}
from the main jsp page I'm trying to call the function but with no luck using the following line:
liSummary.calcNeededLi((Integer)session.getAttribute("value1"),(Double)session.getAttribute("value2
"))
however, this outputs the error message:
java.lang.ClassCastException: java.lang.String
Anybody have any idea why? Thanks (in advance)