jsp路徑記錄,spring boot 項目部署到Tomcat後EL表達式無法解析

目錄

1、el標籤識別問題

1.1、每個jsp增加一個配置

1.2、配置web.xml

2、路徑整理


 

 

 

 

1、el標籤識別問題

1.1、每個jsp增加一個配置


<%--el標籤無法識別的問題--%>
<%@ page isELIgnored="false" %>

1.2、配置web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
         http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">


    <display-name>Archetype Created Web Application</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>false</el-ignored>
        </jsp-property-group>
    </jsp-config>

</web-app>

 

 

2、路徑整理

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/view/jsp/include/taglib.jsp" %>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>${SysParam.indextitle}</title>
    <%
        String path = request.getContextPath();
        String basePath = request.getServerName() + ":" + request.getServerPort() + path + "/";
        String baseUrlPath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    %>
    <script type="text/javascript">
        var path = '<%=path%>';
        var basePath = '<%=basePath%>';
        var baseUrlPath = '<%=baseUrlPath%>';
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%--  <script type="text/javascript">
          location.href = "market.business.managerList/index.html"
      </script>--%>
</head>
<body>
<h1>這個是CRM</h1>


<a href="${swaggerUrl}">swagger地址</a>


<a href="${baseUrlPath}swagger-ui.html">baseUrlPath</a>

</body>
</html> 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章