base.jsp

来源:互联网 发布:西安网络写手招聘 编辑:程序博客网 时间:2024/06/06 21:01
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String projectPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
String staticPath = projectPath + "/static";
String imagePath = projectPath + "/uploads";
%>
<%--项目路径 --%>
<c:set var="basePath" value="<%=projectPath%>"></c:set>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%--静态资源路径 --%>
<c:set var="ctxsta" value="${pageContext.request.contextPath}/static"/>
<%--页面显示图片的前缀路径--%>
<c:set var="ctximg" value="${pageContext.request.contextPath}/uploads"/>

原创粉丝点击