jsp中路径的问题
工作快一年了,直到今天才理解下面代码的含义。
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<head>
<base href="<%=basePath%>">
<title>My JSP 'login.jsp' starting page</title>
…………
</head>
很简单上面的代码定义了一个基础路径。

上面是项目的结构。下面的是页面中的代码

呵呵,这样的话就可以很方便地只用绝对路径了。
有点惭愧,得努力看书。