Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

User session and refresh frames in jsp  RSS feed

 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I removed the term "Urgent" from your subject. Please read this.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
kirtikumar patel
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!