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
410 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
[X]
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
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
check java version using powershell 13 298
Print Rhino Java Array in Javascript 1 37
Java class and jar 3 42
Coding for the first time 9 68
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

733 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