This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have seen how to store an object in a session and the syntax is
and we usually put String(s) in that object; for example, we have a customer object and we do the following:
Is it possible to store a String in a session? What if I only want to store a String "origin" in a session so that this String can be passed to all subsequent requests?
JiaPei - Guess what? A String is an Object !! . So yes, you can put a String object in the session. Just remember that when you use session.getAttribute("yourParameter"), it'll always return an Object, so you'll have to typecast it to a String.
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Can We Store Something Other Than An Object In A Session?