java:
getServletContext().getRealPath("/")
struts2:
ResourceBundle resource = ResourceBundle.getBundle("voicefileInfo");
ActionContext ac = ActionContext.getContext();
ServletContext sc = (ServletContext) ac.get(ServletActionContext.SERVLET_CONTEXT);
String LogDir = sc.getRealPath("/").concat(resource.getString("LogDir"));
都可利用severlet中的getRealPath("/")方法