Research Log of Web Science Students

Computer Science is not simply programming

The difference of a request from a session

leave a comment »

REMEMBER: Sessions have longer “lives” than requests. Not until a user logs out will the attributes of a session banish. Requests are used per transaction. Every page change is a new request. So if we want to have a data “remembered” all throughout, we’ll do this:

HttpSession session = request.getSession();
session.setAttribute(“stringvariable”, dataIwantToStore);

HttpSession session = request.getSession(); session.setAttribute(“stringvariable”, dataIwantToStore);

Advertisements

Written by Daniela

November 20, 2009 at 6:48 pm

Posted in ProjectriX

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: