FileDocCategorySizeDatePackage
JWSAdHocServletRequestWrapper.javaAPI DocGlassfish v2 API3770Fri May 04 22:34:12 BST 2007com.sun.enterprise.appclient.jws

JWSAdHocServletRequestWrapper

public class JWSAdHocServletRequestWrapper extends HttpServletRequestWrapper
Wrapper around HttpServletRequest used for forwarding requests for the initial JNLP document for an app client - which arrives at the ad hoc servlet - off to the system servlet for processing.
author
tjquinn

Fields Summary
private String
adjustedPathInfo
Constructors Summary
public JWSAdHocServletRequestWrapper(HttpServletRequest request, String contextRoot, String category)
Creates a new instance of AdHocServletRequestWrapper

        super(request);
        setUserInfo(contextRoot, category);
    
Methods Summary
public java.lang.StringgetPathInfo()
Returns the adjusted path information for use in the system web app.

return
path info reflecting the request category (appclient or application) and the context root indicating which app client is of interest

        return adjustedPathInfo;
    
private java.lang.StringremoveLeadingSlash(java.lang.String path)
Removes any leading slash from the path segment.

param
path the path from which to remove any leading slash
return
the path with any leading slash removed

        String result = null;
        /*
         *Exclude a slash at the beginning of the context root.
         */
        int slash = path.indexOf("/");
        if (slash == 0 && path.length() > 1) {
            result = path.substring(1);
        } else {
            result = path;
        }
        return result;
    
private voidsetUserInfo(java.lang.String contextRoot, java.lang.String category)


        adjustedPathInfo = "/" + removeLeadingSlash(category) + "/" + removeLeadingSlash(contextRoot);