The jsp page gets the current user and passes it to the JS page

jsp页面获取当前用户,传给JS页面
<%
SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd");
User user = (User) session.getAttribute("user");
%>
<script type="text/javascript">
var curEmplName = '<%=user.getEmplName()%>';
var curUserName = '<%=user.getUserName()%>';
var curTime = '<%=sdFormat.format(new Date())%>';
</script>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326566384&siteId=291194637