• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding int value in to a session

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,
In my project here i'm using int values like 0 and 1 to make the account active or inactive. It is working perfectly in my local machine and when i uploaded the war file to the remote server, it is showing error

my code is here


It is running perfectly in my local machine which is not showing the error. When i uploaded it in the remote machine i'm getting the following error




Please help me ranchers..
I want to remove this error. from the remote server..
Today evening i want to show the uploaded file running..fine..

Please help me as soon as possible..
Thanks in advance

regards

Aravind Prasad
 
Balasubramani Dharmalingam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aravind,
What is the JVM that you are using in your local machine ..?
I think it will be JDK 1.5 or later.. and your remote server is running in 1.4 ..I JDK 1.5 primitive values are automatically boxed into its corresponding wrapper object. So its running fine in your machine.

But this auto boxing wont happen in JDK 1.4.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To add to Balasubramani's answer.
The simplest fix is to box your primitives yourself.

 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also,
The putValue method has been deprecated for a long time.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html

I would advise not using deprecated methods in your project.
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou very much Balasubramani and Ben..
My Program worked perfectly..

I thought the problem was
I was using Windows machine for local test and the remote system was Linux..I thought the problem was that.

Now i'm really happy.. I showed my demo.. and my boss appreciated me!!

Itz all because of you and Java Ranche

regards

Aravind Prasad
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,
When i put for the session.getValue("status") also it is giving the error

the code is here



The error i'm getting is here



Please Help me ranchers..

Thanks in advance

regards

Aravind Prasad
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65126
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aside from the error, why are you using deprecated methods?

What's on line 2 of your JSP?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic