Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

What is the cause of a session attribute value in a JSP being set to null when it was a string?

Posted on 2011-09-23
2
409 Views
Last Modified: 2012-05-12
I am setting the value of a session attribute to a string value in let's call JSP 1 and the next JSP that is displayed is retrieving the value and then the attribute value is null in the next JSP 2 which is displayed next.
For example:

setAttribute("var1", "acme widgets");

var1 is set to "acme widgets"

However var1 in the mean time set to null

null == getAttribute("var1")
0
Comment
Question by:jwright9
2 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
ID: 36589431

Passing parameters between JSP through session should be straight forward
cehck this:
http://www.roseindia.net/jsp/jspsessions.shtml
You should  sue expeicitly
session.setAttribute(...)

session.getAttribute()

you may check if the session itself is not null in the second page first




this is about various ways oof passing parameters between JSP - maybe it would help
http://stackoverflow.com/questions/862440/jsp-parameter-passing-without-use-of-html-forms
0
 

Author Closing Comment

by:jwright9
ID: 36599382
Thanks for the help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question