前台获取信息进行跳转

1、不在js中

<c:if test="${empty sessionScope.adminAccount}">
       <c:redirect url="${ctx}/yxladmin.jsp" context="/" />
</c:if>

2、在js中

if($.trim("${sessionScope.adminAccount}") == "")
{
       top.location.href="${ctx}/yxladmin.jsp";
}

原文地址:https://www.cnblogs.com/jirglt/p/3299083.html