marc goroff

Greenhorn
+ Follow
since Jul 12, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by marc goroff

If I have a frame situation, one frame is a menu, and one is an online store. I am using sessions to keep track of the inevntory that has been selected. Since the menu frame is static, how can I have it updated with the current session info?
22 years ago
It might have been helpful to mention this before, I use the following call to transfer to the new servlet.
response.sendRedirect( response.encodeRedirectUrl( "/servlets/ShoppingBasketServlet" ) );
Anyway, I am not too worried about the code, I just wonder why it does NOT work on Netscape, but does on IE. I realize the (true) argument causes a new session to be created, that is the problem. Why is the session null. What would/could cause it to be lost.
22 years ago
I am trying to implement a shopping cart. I have servlet which adds items to a cart, and then sends a redirect to another servlet to display the contents of the cart. If I test this using IE, it works just fine, when I test it using Netscape 4.7, the cart is always empty.
Code this adds to the cart:
HttpSession session = request.getSession(true);

if ( session != null ) {

Vector basket = (Vector)session.getValue("basket");

if ( basket == null ) {
basket = new Vector(5);
session.putValue("basket", basket);
}
// Add the passed in frame to the basket.
basket.addElement(frame);
}
**********************************************************
this reads out of the cart
HttpSession session = request.getSession(true);
basket = (Vector)session.getValue("basket");
22 years ago