• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data in new Pop-up window.

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My jsp page has an arraylist. I want to display data in that arraylist in a new pop-up window on click of hyperlink. Please suggest some suitable option. would like to avoid using session attribute.

Regards,
Neeraj.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could print the table to the page as a Javascript array and then pass that array to the popupwindow in a Javascript function.

The HTML/Javascript forum would be the best place to go if you need help with this.


Why don't you want to use sessions?
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks Ben..Would like to avoid session variable because of performance issues.

is there any other option other than java script.

Regards,
Neeraj.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neeraj Vij:
Hi,

Thanks Ben..Would like to avoid session variable because of performance issues.
is there any other option other than java script.

Regards,
Neeraj.



Without using javascript or a session variable, you have to generate the table from scratch in the popup window's request.

How is using a session variable negatively affecting performance?
In this case, it would seem to me, that it would greatly enhance performance.
[ June 14, 2005: Message edited by: Ben Souther ]
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,

Please correct me, If I am wrong.I feel, maintaing too many session attributes will degarde the server's performance.

Regards,
Neeraj.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Neeraj Vij:
Hi Ben,
Please correct me, If I am wrong.I feel, maintaing too many session attributes will degarde the server's performance.
Regards,
Neeraj.



It depends on how your app is being used and what you mean by too many.
If you have a constant amount of heavy traffic or large spikes then having a lot of session references could keep Garbage Collection (GC) from being able to free up memory.

On the other hand caching and reusing objects via sessions can reduce the number of objects created which will lower memory consumption and reduce the number of time GC needs to run,

Let's look at this case:
Your first request hits the the main JSP which queries the database and gets the needed data. You store it in session. The popup window's request pulls the data from session and returns quickly. You've eliminated a trip to the database and all of the object creation invloved with that process.

If GC happens to run before that session has expired then it won't clean up that object (whatever you were storing the table in). It will linger until the next time GC runs. If GC doesn't run during that session's lifespan, storing the object in session cost you nothing. The object is going to stay in memory until GC cleans it up whether it was ever bound to a session or not.

What kind of app is it? Is it something that many people will log into and work with for long periods of time or is it more like an ecommerce site where people login, check for something, buy or not, and leave?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic