I have some code which see if a session attribute has a value, but it is throwing up a "NullPointerException" error. My code is below.
[tt] //problems with this
String testLang = (String)session.getAttribute("lang");
if (testLang.equals(null))
{
session.setAttribute("lang", "English");
testLang = "English";
}[/tt]
Is there a way to find is a session attribute is set, then if not set it?
Thanking you in advance
Rick
[tt] //problems with this
String testLang = (String)session.getAttribute("lang");
if (testLang.equals(null))
{
session.setAttribute("lang", "English");
testLang = "English";
}[/tt]
Is there a way to find is a session attribute is set, then if not set it?
Thanking you in advance
Rick