我希望获得部署项目的远程地址或服务器地址。让我们假设
http://www.myname.com/ : host
deployedProj : deployed web App name
folderName : there is a folder inside the web App
i want to access this address : http://www.myname.com/deployedProj/folderName
答案 0 :(得分:-1)
您可以使用requestDispatcher ...
做一件事1.in servlet Action Class: req.getRequestDispatcher("/your_WebApp_Name/folder_inside_project").forward(req,res);
e.g req.getRequestDispatcher("/deployedProj/folderName").forward(req,res);
2. in JSP,
<%=request.getRequestURL()%>