Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

session/application variable set in JSP, lookup in Servlet.  RSS feed

Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have set a session, application var. in a JSP as follows:
then this JSP will call a Servlet and from that Servlet I am try to use those session, application var. as follows:

HttpSession session = request.getSession(false);
Boolean tmpb = new Boolean((String)session.getAttribute("debugmode"));
BufferedWriter log = (BufferedWriter)getServletContext().getAttribute("log")

Which is nothing complicated but both values are null when I try to retriev them from the Servlet.
Can someone shed some light on this?

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!