How to use session in JSP pages to get information?

前端 未结 7 2271
北恋
北恋 2020-11-27 03:14

I have a JSP page used for editing some user\'s info. When a user logins to the website, I keep the information in the session, then in my edit page I try the following:

7条回答
  •  轮回少年
    2020-11-27 03:44

    You can directly use (String)session.getAttribute("username"); inside scriptlet tag ie <% %>.

提交回复
热议问题