1 23 24 package com.sun.enterprise.appclient.jws; 25 26 import javax.servlet.http.HttpServletRequest ; 27 import javax.servlet.http.HttpServletRequestWrapper ; 28 29 36 public class JWSAdHocServletRequestWrapper extends HttpServletRequestWrapper { 37 38 private String adjustedPathInfo; 39 40 41 public JWSAdHocServletRequestWrapper(HttpServletRequest request, String contextRoot, String category) { 42 super(request); 43 setUserInfo(contextRoot, category); 44 } 45 46 private void setUserInfo(String contextRoot, String category) { 47 48 adjustedPathInfo = "/" + removeLeadingSlash(category) + "/" + removeLeadingSlash(contextRoot); 49 } 50 51 56 public String getPathInfo() { 57 return adjustedPathInfo; 58 } 59 60 65 private String removeLeadingSlash(String path) { 66 String result = null; 67 70 int slash = path.indexOf("/"); 71 if (slash == 0 && path.length() > 1) { 72 result = path.substring(1); 73 } else { 74 result = path; 75 } 76 return result; 77 } 78 } 79 | Popular Tags |