School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,435 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,477 people online right now. Registration is fast and FREE... Join Now!




error problem

 

error problem, i got NullPointerException in HttpSession pls help

sonirameshr

26 Jun, 2009 - 02:17 AM
Post #1

New D.I.C Head
*

Joined: 24 Nov, 2008
Posts: 6

Integer i=new Integer(0);
HttpSession session=getHttpSession();
if(session.isNew()){
i=1;
session.setAttribute("x",i);
System.out.println(i);
}else{
i=(Integer)session.getAttribute("x");
i++;
System.out.println(i);
session.setAttribute("x",i);
}

In this program i want in first attempt to set value of 'x' as 1 & then 2,3,4...

User is offlineProfile CardPM
+Quote Post


Smurphy

RE: Error Problem

26 Jun, 2009 - 08:21 AM
Post #2

D.I.C Regular
Group Icon

Joined: 7 Jul, 2008
Posts: 251



Thanked: 7 times
Dream Kudos: 25
My Contributions
So you want to loop through the numbers?
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 12:55AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month