That wont work. i* are all defined as ints. putValue needs a java.lang.Object. Without looking more at ur code. I'll have to say that u didnt give any values to those hidden input fields. Remember that an input type defaults to a string value so it will have no value unless u give it one.
-Tim
-----Original Message-----
From: Eric Fleming [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 11:32 AM
To: [EMAIL PROTECTED]
Subject: Re: Help in session...

Try doing this:
 
<%
session.putValue("total_inc", iTotalIncome);
session.putValue("total_exp", iTotalExpenses);
session.putValue("net_savings", iNetSavings);
%>
 
Eric
----- Original Message -----
From: Joey A
Sent: Tuesday, November 13, 2001 11:13 am
Subject: Help in session...

Hi all,
I'm having some problems using 'session' in my JSP's. Please let me know if anyone of you could help in this code:
 
From the first page, I'm passing these values to the second page:
 
<INPUT type="Hidden" maxlength="10" name="total_inc" size="10">
<INPUT type="Hidden" maxlength="10" name="total_exp" size="10">       
<INPUT type="Hidden" maxlength="10" name="net_savings" size="10">
 
In second page, I'm trying to assign them to new intergers like:
<%  
int iTotalIncome=Integer.valueOf(request.getParameter("total_inc")).intValue();
int iTotalExpenses=Integer.valueOf(request.getParameter("total_exp")).intValue();
int iNetSavings=Integer.valueOf(request.getParameter("net_savings")).intValue();
%>
 
And then put them in session:
 
<%
session.putValue("total_inc", iTotalIncome);
session.putValue("total_exp", iTotalExpenses);
session.putValue("net_savings", iNetSavings);
%>
 
Finally to access them anywhere:
 
<%out.print(session.getValue("total_inc"));%>
<%out.print(session.getValue("total_exp"));%>
<%out.print(session.getValue("net_savings"));%>
 
I'm getting the followint error:
java.lang.NumberFormatException: null
 at java.lang.Integer.parseInt(Compiled Code)
 at jrun__trial__cashflow__Jo_result2ejsp1d._jspService(jrun__trial__cashflow__Jo_result2ejsp1d.java:49)
 at allaire.jrun.jsp.HttpJSPServlet.service(Compiled Code)
 at allaire.jrun.jsp.JSPServlet.service(Compiled Code)
 at allaire.jrun.jsp.JSPServlet.service(Compiled Code)
 at allaire.jrun.servlet.JRunSE.service(Compiled Code)
 at allaire.jrun.session.JRunSessionService.service(Compiled Code)
 at allaire.jrun.servlet.JRunSE.runServlet(Compiled Code)
 at allaire.jrun.servlet.JRunRequestDispatcher.forward(Compiled Code)
 at allaire.jrun.servlet.JRunSE.service(Compiled Code)
 at allaire.jrun.servlet.JRunSE.service(Compiled Code)
 at allaire.jrun.servlet.JvmContext.dispatch(Compiled Code)
 at allaire.jrun.jrpp.ProxyEndpoint.run(Compiled Code)
 at allaire.jrun.ThreadPool.run(Compiled Code)
 at allaire.jrun.WorkerThread.run(Compiled Code)
 
Can anyone point out the error?
Thanx,
Joey

Reply via email to