• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

User session and refresh frames in jsp

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

I have three frames on my web page.

Top frame represents some kind of header info.
Left frame is used for navigation.
Central frame is data frame.

Now in this central frame

I have a jsp (a.jsp) file which has two submit buttons (one is 'update', second - 'submit'). On 'update' it calls itself and updates some parameters on the page and also updates some values in user session.

This jsp file also includes another jsp (b.jsp) using <jsp:include> in the beginning. This b.jsp sets value of requestURI and RquestQuerystring in user session.

I have third jsp c.jsp which actually draws all three frames which I mentioned above.

In header frame I have 'refresh' button to refersh all three frames. This button calls c.jsp to do this.

I also have some kind of notification mechanism implemented. So upon getting notification I refresh all three frames using javascript.


Now the problem is that in a.jsp on 'update' button I set userSession attribute 'method' to some value ('update'), then it calls itself and gets that attribute value 'update' do some processing and then sets that attribute to 'null'. Now at this stage if I get notification (which in turn refreshes all the frames )
it will refresh central frame and executes a.jsp again. During this execution it tries to retrieve attribute 'method' from usersession (which I have already set to null). Here it some how always retrieves value 'update' rather than 'null'.

I donot understand why is this happening and what is the solution. Any help is appreciated.

I know my question sounds confusing but help me...

Thanks
[ June 29, 2005: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I removed the term "Urgent" from your subject. Please read this.
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah Priti you are right, it�s very confusing.

I guess you are facing this problem, because your a.jsp page is already processing some thing and has not reached to session.setAtribute(�method�, null) statement.
Now at this stage if you refresh the page it will fire session.getAttribute(�method�) , which in turn return �update� as session.setAtribute(�method�, null) statement has not processed yet.

Let me know this works or not.
 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Chetan,

What you are telling is not the case because before refreshing i print value of that attribute and it prints null. But when page refreshes it takes old values from session not modified one. That is the main problem. I donot understand why and how it happens.

Thanks for your reply.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi! priti
I want to know one think from you that why you are persist value of method variable in session but you can store it in request object.
I think after follow this and you can resolve your problem.
[ July 01, 2005: Message edited by: Bear Bibeault ]
 
Switching from electric heat to a rocket mass heater reduces your carbon footprint as much as parking 7 cars. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic