问题描述
当使用${pageContext.request.contextPath}找到绝对路径时,url会出现如上图所示的问题,表示链接出现问题。
原因:
web-app的版本低于2.4
解决方法
此时找到web.xml文件,把web-app的版本修改即可
原来是这样
现在修改为这样:
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"
metadata-complete="true">