guys, good day...

I know that this is just easy but i've been tweening my work the whole afternoon but no luck. my problem is using setAttribute for java's client-side programming. I just want to create session for my username to be able to use while being logged in. this is just easy for server-side since I will only be using session.setAttribute("", var); but I also want to do the same in client-side. What is the equivalent of session.setAttribute() for client-side? Thank you.

you mean the client of your web application? There is no Java running there, only Javascript which knows nothing about all that.
The only thing you can do is set a cookie, which is automatically handled for you (if possible and needed) by the server based on the content of the serverside session object.

If you mean you have a Java program running outside an application server environment, you won't have access to the session management features of the application server, obviously, and will have to implement something similar yourself (or search the net for something created by others).

@jwenting:

Im currently working on a Java Desktop Application. I just want to know what is the equivalent of session.setAttribute(): of servlet to java desktop. thanks for the reply.

problem solved!

the equivalent of session.setAttribute(); for client-side is System.setProperty();

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.