今天在使用idea开发一个web项目的时候,页面404,并显示路径$%7BpageContext.request.contextPath%7D,我在jsp页面中明明使用的是${pageContext.request.contextPath},查找之后发现是在建项目的时候web-app版本问题,我的web.xml中头文件的配置是:

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >

将其改为:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2021-04-23
猜你喜欢
  • 2021-08-20
  • 2021-09-24
  • 2021-08-23
  • 2022-01-01
  • 2022-12-23
  • 2021-11-22
  • 2021-05-30
相关资源
相似解决方案