Package org.eclipse.jetty.util

Examples of org.eclipse.jetty.util.Attributes


    @ManagedAttribute("Map of context attributes")
    public Map<String,Object> getContextAttributes()
    {
        Map<String,Object> map = new HashMap<String,Object>();
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        Enumeration<String> en = attrs.getAttributeNames();
        while (en.hasMoreElements())
        {
            String name = (String)en.nextElement();
            Object value = attrs.getAttribute(name);
            map.put(name,value);
        }
        return map;
    }
View Full Code Here


    }
   
    @ManagedOperation(value="Set context attribute", impact="ACTION")
    public void setContextAttribute(@Name(value = "name", description="attribute name") String name, @Name(value = "value", description="attribute value") Object value)
    {
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        attrs.setAttribute(name,value);
    }
View Full Code Here

    }
   
    @ManagedOperation(value="Set context attribute", impact="ACTION")
    public void setContextAttribute(@Name(value = "name", description="attribute name") String name, @Name(value = "value", description="attribute value") String value)
    {
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        attrs.setAttribute(name,value);
    }
View Full Code Here

    }
   
    @ManagedOperation(value="Remove context attribute", impact="ACTION")
    public void removeContextAttribute(@Name(value = "name", description="attribute name") String name)
    {
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        attrs.removeAttribute(name);
    }
View Full Code Here

            request = new ServletRequestHttpWrapper(request);
        if (!(response instanceof HttpServletResponse))
            response = new ServletResponseHttpWrapper(response);

        final DispatcherType old_type = baseRequest.getDispatcherType();
        final Attributes old_attr=baseRequest.getAttributes();
        final MultiMap<String> old_query_params=baseRequest.getQueryParameters();
        try
        {
            baseRequest.setDispatcherType(DispatcherType.INCLUDE);
            baseRequest.getResponse().include();
View Full Code Here

        final String old_context_path=baseRequest.getContextPath();
        final String old_servlet_path=baseRequest.getServletPath();
        final String old_path_info=baseRequest.getPathInfo();
       
        final MultiMap<String> old_query_params=baseRequest.getQueryParameters();
        final Attributes old_attr=baseRequest.getAttributes();
        final DispatcherType old_type=baseRequest.getDispatcherType();

        try
        {
            baseRequest.setHandled(false);
            baseRequest.setDispatcherType(dispatch);

            if (_named!=null)
            {
                _contextHandler.handle(_named, baseRequest, (HttpServletRequest)request, (HttpServletResponse)response);
            }
            else
            {
                ForwardAttributes attr = new ForwardAttributes(old_attr);

                //If we have already been forwarded previously, then keep using the established
                //original value. Otherwise, this is the first forward and we need to establish the values.
                //Note: the established value on the original request for pathInfo and
                //for queryString is allowed to be null, but cannot be null for the other values.
                if (old_attr.getAttribute(FORWARD_REQUEST_URI) != null)
                {
                    attr._pathInfo=(String)old_attr.getAttribute(FORWARD_PATH_INFO);
                    attr._query=(String)old_attr.getAttribute(FORWARD_QUERY_STRING);
                    attr._requestURI=(String)old_attr.getAttribute(FORWARD_REQUEST_URI);
                    attr._contextPath=(String)old_attr.getAttribute(FORWARD_CONTEXT_PATH);
                    attr._servletPath=(String)old_attr.getAttribute(FORWARD_SERVLET_PATH);
                }
                else
                {
                    attr._pathInfo=old_path_info;
                    attr._query=old_uri.getQuery();
View Full Code Here

           
       
        // TODO - allow stream or writer????
       
        final DispatcherType old_type = baseRequest.getDispatcherType();
        final Attributes old_attr=baseRequest.getAttributes();
        MultiMap old_params=baseRequest.getParameters();
        try
        {
            baseRequest.setDispatcherType(DispatcherType.INCLUDE);
            baseRequest.getConnection().include();
View Full Code Here

        final String old_uri=baseRequest.getRequestURI();
        final String old_context_path=baseRequest.getContextPath();
        final String old_servlet_path=baseRequest.getServletPath();
        final String old_path_info=baseRequest.getPathInfo();
        final String old_query=baseRequest.getQueryString();
        final Attributes old_attr=baseRequest.getAttributes();
        final DispatcherType old_type=baseRequest.getDispatcherType();
        MultiMap<String> old_params=baseRequest.getParameters();
       
        try
        {
            baseRequest.setHandled(false);
            baseRequest.setDispatcherType(dispatch);
           
            if (_named!=null)
                _contextHandler.handle(_named,baseRequest, (HttpServletRequest)request, (HttpServletResponse)response);
            else
            {
               
                // process any query string from the dispatch URL
                String query=_dQuery;
                if (query!=null)
                {
                    // force parameter extraction
                    if (old_params==null)
                    {
                        baseRequest.extractParameters();
                        old_params=baseRequest.getParameters();
                    }
                   
                    baseRequest.mergeQueryString(query);
                }
               
                ForwardAttributes attr = new ForwardAttributes(old_attr);
               
                //If we have already been forwarded previously, then keep using the established
                //original value. Otherwise, this is the first forward and we need to establish the values.
                //Note: the established value on the original request for pathInfo and
                //for queryString is allowed to be null, but cannot be null for the other values.
                if (old_attr.getAttribute(FORWARD_REQUEST_URI) != null)
                {
                    attr._pathInfo=(String)old_attr.getAttribute(FORWARD_PATH_INFO);
                    attr._query=(String)old_attr.getAttribute(FORWARD_QUERY_STRING);
                    attr._requestURI=(String)old_attr.getAttribute(FORWARD_REQUEST_URI);
                    attr._contextPath=(String)old_attr.getAttribute(FORWARD_CONTEXT_PATH);
                    attr._servletPath=(String)old_attr.getAttribute(FORWARD_SERVLET_PATH);
                }
                else
                {
                    attr._pathInfo=old_path_info;
                    attr._query=old_query;
View Full Code Here

    }

    public Map getContextAttributes()
    {
        Map map = new HashMap();
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        Enumeration en = attrs.getAttributeNames();
        while (en.hasMoreElements())
        {
            String name = (String)en.nextElement();
            Object value = attrs.getAttribute(name);
            map.put(name,value);
        }
        return map;
    }
View Full Code Here

        return map;
    }
   
    public void setContextAttribute(String name, Object value)
    {
        Attributes attrs = ((ContextHandler)_managed).getAttributes();
        attrs.setAttribute(name,value);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.Attributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.