日期:2014-05-17 浏览次数:20651 次
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <%! /** * 获取站点根目录 * @param request * @return */ public static String GetRootPath( javax.servlet.http.HttpServletRequest request) { String path = request.getContextPath(); return path; } %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <% //获取站点根目录 String rootPath=GetRootPath(request); %> <!-- 以下是显示结果 --> <%=rootPath%> </body> </html>