Map.Entry entry = (Map.Entry)iter.next(); String name=(String)entry.getKey(); Object values=entry.getValue(); for (int i=0;i<LazyList.size(values);i++) parameters.add(name, LazyList.get(values, i));
Iterator iter = old_params.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); String name=(String)entry.getKey(); Object values=entry.getValue(); for (int i=0;i<LazyList.size(values);i++) parameters.add(name, LazyList.get(values, i)); }
    public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException    {        Request base_request=(request instanceof Request)?((Request)request):HttpConnection.getCurrentConnection().getRequest();                // TODO - allow stream or writer????                Attributes old_attr=base_request.getAttributes();        MultiMap old_params=base_request.getParameters();        try        {            base_request.getConnection().include();            if (_named!=null)                _contextHandler.handle(_named, (HttpServletRequest)request, (HttpServletResponse)response, Handler.INCLUDE);            else             {                String query=_dQuery;                                MultiMap parameters=new MultiMap();                UrlEncoded.decodeTo(query,parameters,request.getCharacterEncoding());                                if (old_params!=null && old_params.size()>0)                {                    // Merge parameters.                    Iterator iter = old_params.entrySet().iterator();                    while (iter.hasNext())                    {                        Map.Entry entry = (Map.Entry)iter.next();                        String name=(String)entry.getKey();                        Object values=entry.getValue();                        for (int i=0;i<LazyList.size(values);i++)                            parameters.add(name, LazyList.get(values, i));                    }                                    }                base_request.setParameters(parameters);                                                IncludeAttributes attr = new IncludeAttributes(old_attr);                                 attr._requestURI=_uri;                attr._contextPath=_contextHandler.getContextPath();                attr._query=query;                                base_request.setAttributes(attr);                                _contextHandler.handle(_named==null?_path:_named, (HttpServletRequest)request, (HttpServletResponse)response, Handler.INCLUDE);            }        }        finally        {            base_request.setAttributes(old_attr);            base_request.getConnection().included();            base_request.setParameters(old_params);        }    }