basepath项目根路径问题()

来源:互联网 发布:易游网络验证源码 编辑:程序博客网 时间:2024/06/06 13:06
<%@page import="cn.bluemobi.constant.BlueMobiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<base href="<%=basePath%>" />


默认是在webInf下面,当把项目放在webRoot的子目录 ,即和 webInfo相同等级时,就要用../返回上一级目录才能访问到对应的JSP页面

原来 
    @RequestMapping(value = "/findAuthorityList")
    public String findAuthorityList() {
        List<Group> list = groupService.getAllGroups();
        request.setAttribute("groupList", list);
        return "(../page)/admin/user_manage/authorityList.jsp";
    }

0 0
原创粉丝点击