lanxulin 发表于 2013-2-6 09:59:43

jsp或action中获得url路径

http://localhost:8080/rootWeb
String path = request.getScheme()   
                    +"://"  
                    + request.getServerName()   
                   + ":" + request.getServerPort()   
                    + request.getContextPath()  
 
String dir = servlet.getServletContext().getRealPath("/temp"); //当前文件夹temp所在路径
页: [1]
查看完整版本: jsp或action中获得url路径