jsp页面中获得session中存储的值或者对象

xiaoxiao2021-02-28  175

在jsp页面上通过JSTL标签获取Session:

获取session中的值:

session.setAttribute("username","admin"); ${ sessionScope.username} 在页面上显示的就是admin了 获取session中的对象: session.setAttribute("User",user); ${sessionScope.User.getUserName()}在页面上显示user对象中username属性的值

转载请注明原文地址: https://www.6miu.com/read-61154.html

最新回复(0)