JSP获取根目录

commom.jsp

<%@page import="java.io.*" %>
<%
String fileName = application.getRealPath(request.getRequestURI());
String rootPath = new File(new File(fileName).getParent()).getParent();
%>

posted @ 2013-01-28 16:24  RattanyiXu  阅读(1729)  评论(0编辑  收藏  举报