Controller: 1.Struts2: String path = ServletActionContext.getServletContext().getRealPath(UPLOADDIR); 2.SpringMVC: String path1 = request.getSession().getServletContext().getRealPath("/videos/download"); 3.Servlet: String path = getServletContext().getRealPath("/videos/newvideos"); JSP: <%=request.getContextPath()%> ${pageContext.request.contextPath }