File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes HttpSession or java beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "HttpSession or java beans" Watch "HttpSession or java beans" New topic

HttpSession or java beans

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hi All -

I'm developing a simple web application using JSPs and Servlets. I need to store and retrieve parameters selected (such as Category, Date etc) by user. I'm not sure which one is better: HttpSession or java beans. I would appreciate any guidance.

Thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62275

It's not an either/or choice. You create the Java beans containing your data and store them in one of the scope contexts -- one of which can be session scope.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Bear, Thanks for the response.

Are there any good books which explains using sessions in JSPs and Servlets ?

[ January 17, 2006: Message edited by: Dilip kumar ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Download Chapter 13 of "Core Servlets and Java Server Pages"
13.4 discusses covers this.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: HttpSession or java beans