jsp + session

Hello

i am using pagination concept in my 2 jsp's.

i have 2 links for two different jsp's

i fill the information in 2 different jsp and get their result on same 2 jsp's.

problem is::

when i return back to first jsp, after getting result of second jsp,i get the result back in first jsp

whereas i want when i get back , the page should display nothing

i:e session should be expired

i have used sessions in both jsp's.

any advice................

[508 byte] By [sonia_lalita] at [2007-10-2 16:49:08]
# 1
In second jsp call session.invalidae.(); to drop session.
kailash.gunda at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

But when I write session.inValidate(); in second jsp

I don抰 get the remaining records from database

As I m using paging in jsp to display maximum of 10 records on a page

If I use session.inValidate(); it shows only first 10 records and rest of the records get lost due to invalidation of session.

Kindly suggest now what to do厖厖?

sonia_lalita at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Will you kindly explain your problem more clearly?ram.
Madathil_Prasada at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> But when I write session.inValidate(); in second jsp

> I don抰 get the remaining records from database

I don't know what you store in your Session object but it should be possible to get the values from the database even if the session does not exist. The only information what you may loose should be chached values and the paging information i.e. the page would display the first page of the database query.

Your second page can either set a flag which tells the first page that you pressed the back button of the second page. Or you remove some attributes from the session when you display the second page to force the first page to display an empty page.

> Kindly suggest now what to do厖厖?br>From your description it is not clear what's the "best" solution.

andi

andiha at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

I have 2 links for two different jsp's.Records from database gets displayed in both of them

I have set as default to display only 10 records per linkof First,Prev,Next,Last .when I will click on 擭ext ?link then next 10 records get displayed and so on?upto maximum limit of records from database.

i fill the information in 2 different jsp and get their result on same 2 jsp's.

problem is::

When I write session.inValidate(); in second jsp

I don抰 get the remaining records from database when I click on 揘ext ?link i:e if there are total of 50 records divided in 5 pages of 10 records each.then only 10 records gets displayed when I click on next link ,remaining records gets lost .It throws Null

Pointer Exception due to 搃nvalidation of session.?br>Kindly suggest me what to do厖厖?

sonia_lalita at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

There is no need to invalidate the session you can remove a single attribute or even all of them on the second page.

You can allways use getSession(true) which creates a new Session if none exists.

> i fill the information in 2 different jsp and get their result on same 2 jsp's.

I can't immagine what you exactly mean but if it works ;-)

andi

andiha at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
> > i fill the information in 2 different jsp and get> their result on same 2 jsp's.> I can't immagine what you exactly mean but if it> works ;-)You said it :)
Madathil_Prasada at 2007-7-13 18:00:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...