This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Display of Data on Jsp, alternate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display of Data on Jsp, alternate" Watch "Display of Data on Jsp, alternate" New topic
Author

Display of Data on Jsp, alternate

fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
I have some data i want to display on JSP. Standard method would be populate some beans, set beans in arraylist and send arraylist in request and fetch on JSP and display.

What other methods can be used to display data?
Please advise.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

There is no need for an array list. Why do you feel that the beans need to be added to a list before begin "sent" to the JSP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
fahad siddiqui
Ranch Hand

Joined: Jun 14, 2006
Posts: 85
Ok, so the arraylist can be eliminated. But any other patterns which could be used?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

Why is there a need for other patterns? Any data that needs to be passed from the page controller (servlet) to its JSP should be added to the request as scoped vairables (using request.setAttribute()).

If the data needs to persist across multiple request, place it in session scope.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Display of Data on Jsp, alternate