And another thing is that I think that in session as in hashtables you 
only can put objects(String, Integer and so on) no base types such as 
int.

Bye again



----- Missatge Original -----
De: Eric Fleming <[EMAIL PROTECTED]>
Data: Dimarts, Novembre 13, 2001 5:32 pm
Assumpte: 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 
>  To: [EMAIL PROTECTED] 
>  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
> 


__________________________________________________________________
�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