<% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <html> <head> <base href="<%=basePath%>">
每次每次请求都是项目初始地址加访问地址
最新推荐文章于 2024-09-09 17:43:56 发布
本文介绍了一种在JSP页面中设置基础路径的方法,通过获取当前请求的上下文路径、服务器名称、端口等信息来构建完整的资源访问路径。

1万+

被折叠的 条评论
为什么被折叠?



