jsp页面使用表达式跳转报“ attribute for %> is not properly terminated”错误

前言


jsp页面使用表达式<%=basePath%>跳转报“org.apache.jasper.JasperException: /jsp/login/welcome.jsp (line: 26, column: 27) attribute for %>" is not properly terminated”错误,具体如下:


welcom.jsp




错误信息

严重: Servlet.service() for servlet [jsp] in context with path [/pm] threw exception [/jsp/login/welcome.jsp (line: 26, column: 27) attribute for %>" is not properly terminated] with root cause
org.apache.jasper.JasperException: /jsp/login/welcome.jsp (line: 26, column: 27) attribute for %>" is not properly terminated

正确写法

  
     


原因

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

标签允许包含动态和静态页面,其中page属性:page="{relativeURL | <%= expression %>}"可以使用绝对路径或者相对路径。


总结


The End。


你可能感兴趣的:(jsp)