How to check for session in JSP EL?

前端 未结 3 1879
忘掉有多难
忘掉有多难 2020-12-07 03:01

How do you check if a session exists for the request in EL? I\'m trying something like:

 ... <         


        
3条回答
  •  孤街浪徒
    2020-12-07 03:31

    In J2EE there will always be a session object when a user visits a site.

    What is a Session ? A session is pretty much what it sounds, when a user makes a page request to the server, the server creates a temporary session to identify that user. So when that same user goes to another page on that site, the server identifies that user. So a session is a small and temporary unique connection between a server and the user enabling it to identify that user across multiple page requests or visits to that site.

    So basically if your hitting a page you have a session because your using JSP, which eventually gets converted to servlets.

    http://www.stardeveloper.com/articles/display.html?article=2001062001&page=1

提交回复
热议问题