01: package com.opensymphony.webwork.views.util;
02:
03: import javax.servlet.http.HttpServletRequest;
04:
05: import com.opensymphony.webwork.RequestUtils;
06:
07: /**
08: * User: plightbo
09: * Date: May 15, 2005
10: * Time: 6:36:59 PM
11: */
12: public class ResourceUtil {
13: public static String getResourceBase(HttpServletRequest req) {
14: String path = RequestUtils.getServletPath(req);
15: if (path == null || "".equals(path)) {
16: return "";
17: }
18:
19: return path.substring(0, path.lastIndexOf('/'));
20: }
21: }
|