jsp公共头信息的抽取(相对路径的修改)

1,抽取出的公共头信息

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<c:set var="path" value="${pageContext.request.contextPath }"></c:set>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${path }/css/index.css" rel="stylesheet" type="text/css" />
<title></title>
<script type="text/javascript" src="${path }/js/jquery-1.8.3.js"></script>
</head>
<body>
    
</body>
</html>

2,其他jsp页面对公共头信息的包含

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

  

转载于:https://www.cnblogs.com/Mr-Dxin/p/11046240.html

猜你喜欢

转载自blog.csdn.net/weixin_33866037/article/details/93221175
今日推荐