• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Problem  RSS feed

 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a shop application where i am storing the item information in session.

I have a requirement that if user once select an item and reach check out page and again click back button of the application and selects new item then my cart session should have last updated item value rather than all that available in session.

On above lines i have written the below code to remove all the items in session on page load in JSP


Now, when i view the server console, i still see the value for cart session variable.

I am using jboss 5.1.0 server. Please let me know if i am wrong any where.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is item and cart. once you remove item attribute and from cart attribute you get value. Explain with proper..
 
Allen Bandela
Ranch Hand
Posts: 128
Eclipse IDE MS IE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you may need to reload the page as the back button does not actually do that for your code to run. You could probably reload with javascript when the back button is clicked.
 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried reloading a page in this pattern,

i have a back button in my checkout.jsp page just beside a checkout button. Onclicking that i will again call the same cart list page. i.e first page of my cart

i have a html tag like in checkout.jsp page. Here listcart.jsp is my first page where i have written the code to remove the session variables.

please let me know if i should reload the same page in java script also.

To Nishan:

item variable shows me the list of session variables bound to that session and cart is my session variable where i am storing all the items selected by the user from the cart.


 
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
Did you not notice that your HTML is incomplete in your post? How are we supposed to help you if we can't see the code?

There are a bunch of checkboxes under the reply box. Use them to make sure that your post is readable.
 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
extremely sorry for that.

my html tag is as below


 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!