• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display all the session variables from an HTML page?

 
David King
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone know how, using only the session object, to print out all the variables that are stored on that object from html?
Your help is appreciated
------------------
"It's alive, it's alive!" -Young Frankenstien (We all are mad scientists when it comes to getting things to execute perfectly.)
 
Junilu Lacar
Sheriff
Posts: 9997
103
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know if this is what you're looking for or not. There's no way you can do it directly from plain HTML since HTML is static and the session object really "lives" in the dynamic environment of the web container. The only thing the session object exposes are it's attributes and a few other settings which you can read about here: http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html
The following example JSP shows you how to generate HTML that shows the objects in the session attribute collection.

HTH
Junilu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!