写一个如下公共页
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<s:if test="#session.user==null">
<script>location.href="${pageContext.request.contextPath }/page/login.jsp"</script>
</s:if>
<html>
<body><h4>登录判断页面</h4></body>
</html>
在其他页面引入,或者直接写入这些语句即可!
引入
<%@ include file=“author.jsp” %>
自行调整路径!