当前位置:网站首页>Solve the problem that ${pagecontext.request.contextpath} is invalid
Solve the problem that ${pagecontext.request.contextpath} is invalid
2022-07-27 16:21:00 【Java Genie】
${pageContext.request.contextPath} yes JSP The way to get the absolute path
That is, take out the name of the deployed application or the name of the current project
For example, my project name is myself Enter... In the browser localhost:8080/myself
${pageContext.request.contextPath} What you take out is localhost:8080/myself, and http://localhost:8080 use / Instead of , So the path taken is /myself
${pageContext.request.contextPath } Invalidity is mostly due to web.xml The version is too low , It is widely used now web4.0 edition
Here is 4.0 Code for , Replace your web.xml that will do
<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">
</web-app>
边栏推荐
猜你喜欢

Nacos

Servlet basic knowledge points

Leetcode 226 翻转二叉树(递归)

Test novice learning classic (with ideas)

Leetcode 226 flip binary tree (recursive)

webRTC中的coturn服务安装

Leetcode25 question: turn the linked list in a group of K -- detailed explanation of the difficult questions of the linked list

DEX and AMMS of DFI security

Determine the exact type of data

centos yum方式安装mysql
随机推荐
webRTC中的coturn服务安装
makefile 中指定程序运行时加载的库文件路径
快速高效删除node_modules
Sudden! 28 Chinese entities including Hikvision / Dahua / Shangtang / Kuangshi / ITU / iFLYTEK have been blacklisted by the United States
Leetcode 226 翻转二叉树(递归)
Time series ARIMA model
Mapreduce实例(二):求平均值
通俗易懂地区分++i和i++
DRF learning notes (V): viewset
Mysql5.7 master-slave hot standby settings on CentOS
Text capture picture (Wallpaper of Nezha's demon child coming to the world)
DeFi安全之DEX与AMMs
Clickhouse 20.x distributed table testing and chproxy deployment (II)
Common problems of mobile terminal H5
解决MT7620不断循环uboot(LZMA ERROR 1 - must RESET board to recover)
百度图片复制图片地址
可载100人!马斯克发布史上最强“星际飞船” !最早明年上火星!
JMeter5.3 及以后的版本jmeter函数助手生成的字符在置灰无法复制
JSP Foundation
Enable shallow and deep copies+