1)<%= request.getContextPath() %>
获得站点根路径,可以解决相对路径的问题。
比如: <a href="<%= request.getContextPath() %>/catalog.jsp"> 链接到根路径下的catalog.jsp
2)<%= request.getServerName() %>
获取浏览器中显示的主机名
3)<%= getServerPort() %>
服务器端口号
4)<%= request.getScheme() %>
返回协议名称,默认是http
5)<%= request.getRealPath("/") %>
得到项目文件的实际物理路径
829

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



