현재 적용 할 상대 경로 가 져 오기

875 단어 Java
    public String getApplicationContextPath(CommonUploadAware myUpload){
    	HttpServletRequest request = myUpload.getM_request();
//    	System.out.println("getRealContextPath" + EAPConfigHelper.getRealContextPath(request.getSession().getServletContext()));
//    	System.out.println("getRealApplicationPath" + EAPConfigHelper.getRealApplicationPath(request.getSession()));
//    	System.out.println("getRealPath1" + request.getSession().getServletContext().getRealPath("/")); 
		URL url = null ; String weblogic_path = null;
		try {
			url = request.getSession().getServletContext().getResource("/");
			weblogic_path = url.getPath();
			System.out.println("weblogic_path" + weblogic_path); 
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
        return weblogic_path;
    }

좋은 웹페이지 즐겨찾기