我想檢索web應用程序的根路徑,然後我想追加鏈接到根路徑。 我試過request.context,但它返回「http:// localhost:8080/webapp/web-inf」。我應該如何獲取jsp頁面中的根文件夾路徑
例如我的根文件夾路徑是
path = http://localhost:8080/webapp/
,我想剩下的鏈接添加到該路徑
helpPath= /help/page/help.htm
<a href="${path} + ${helpPath}" target="_blank">name</a>
任何幫助或指針非常讚賞。
相關:http://stackoverflow.com/questions/3655316/browser-cant-access-css-and-images-when-calling-a-servlet-which-forwards-to-aj/3658735#3658735 – BalusC 2012-04-26 06:00:25