aspose file tools*
The moose likes JSP and the fly likes Adding int value in to a session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Adding int value in to a session" Watch "Adding int value in to a session" New topic
Author

Adding int value in to a session

Aravind Prasad
Ranch Hand

Joined: Dec 28, 2005
Posts: 265
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

Joined: Dec 06, 2004
Posts: 116
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.


Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="http://sd.balasubramani.googlepages.com" target="_blank" rel="nofollow">www.sd.balasubramani.googlepages.com</a>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

To add to Balasubramani's answer.
The simplest fix is to box your primitives yourself.



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 28, 2005
Posts: 265
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

Joined: Dec 28, 2005
Posts: 265
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

Joined: Jan 10, 2002
Posts: 61654
    
  67

Aside from the error, why are you using deprecated methods?

What's on line 2 of your JSP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Adding int value in to a session