jsp中的request.getContextPath()

<%=request.getContextPath()%>是爲了解決相對路徑的問題,可返回站點的根路徑。 但不用也可以吧,比如<a href="<%=request.getContextPath()%>/catalog.jsp"> 我就直接用<a href="catalog.jsp">也行啊,這兩個文件是在同一個目錄下的 比如你要生成一個文件放在服務器上得一個目錄下,你可以使用request.ge
相關文章
相關標籤/搜索