You don't have any valid value in those hidden fields, so when you jsp 
is trying to convert an empty or null String to an int, it fails with 
an Exception.


Bye, Dani



----- Missatge Original -----
De: Joey A <[EMAIL PROTECTED]>
Data: Dimarts, Novembre 13, 2001 5:13 pm
Assumpte: 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",new Integer(iTotalIncome));
> session.putValue("total_exp",new Integer(iTotalExpenses));
> session.putValue("net_savings",new Integer(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
> 


__________________________________________________________________
�Una p�gina donde te regalan un Scanner HP?. ��Entra y descubrir�s 
sorpresas muy diferentes a las que est�s acostumbrado!! 
 http://www.navegalia.com/portal/compras/index.htm

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to