关于@requestMapping跳转页面静态资源无法加载问题

来源:互联网 发布:java或且非符号 编辑:程序博客网 时间:2024/06/02 05:32

只需在jsp页面加上一下代码即可


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

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">



加粗的为增加的代码

阅读全文
1 0
原创粉丝点击