Examples of UrlAndParams


Examples of org.mikha.utils.net.UrlAndParams

                {
                }
            });
        }

        UrlAndParams url;
        if (value == null)
        {
            url = new UrlAndParams("/");
        }
        else if (value instanceof UrlAndParams)
        {
            url = (UrlAndParams) value;
            if (params.size() > 0)
            {
                url = new UrlAndParams(url); // keep original intact
            }
        }
        else
        {
            url = new UrlAndParams(String.valueOf(value));
        }
        for (Map.Entry<String, Object> e : params.entrySet())
        {
            url.add(e.getKey(), e.getValue());
        }

        Writer w = (var != null ? new StringWriter() : getJspContext().getOut());
        String path = url.getUrl();
        if (path.length() == 0 || url.getUrl().charAt(0) == '/')
        {
            HttpServletRequest req = (HttpServletRequest) ((PageContext) getJspContext()).getRequest();
            w.append(req.getContextPath());
        }

        url.writeTo(true, w);
        if (var != null)
        {
            getJspContext().setAttribute(var, w.toString());
        }
    }
View Full Code Here

Examples of org.mikha.utils.net.UrlAndParams

        String url;
        Map<String, Object> params;
        if (tagUrl instanceof UrlAndParams)
        {
            UrlAndParams uap = (UrlAndParams) tagUrl;
            url = uap.getUrl();
            params = uap.getParams();
        }
        else
        {
            url = tagUrl.toString();
            params = Collections.EMPTY_MAP;
View Full Code Here

Examples of org.mikha.utils.net.UrlAndParams

    @ControllerMethodMapping(paths = "/1")
    public String demoMessage1(HttpParamsRequest req)
    {
        req.setMessage("Default message, param1={0}", new Date());
        req.setAttribute("OkUrl", new UrlAndParams("/action.jsp").p("act", "Ok"));
        return "message.jsp";
    }
View Full Code Here

Examples of org.mikha.utils.net.UrlAndParams

    @ControllerMethodMapping(paths = "/2")
    public String demoMessage2(HttpParamsRequest req)
    {
        req.setMessage("Custom message, Date={0}, Server={1}", new Date(), req.getServerName());
        req.setAttribute("OkUrl", new UrlAndParams("/action.jsp").add("act", "Ok!"));
        req.setAttribute("AbortUrl", new UrlAndParams("http://www.google.com/search").add("q", "президент Буш"));
        return "message.jsp";
    }
View Full Code Here

Examples of org.mikha.utils.net.UrlAndParams

{

    @ControllerMethodMapping
    public void service(HttpParamsRequest req, HttpServletResponse rsp) throws ServletException
    {
        req.redirect(rsp, new UrlAndParams("/action.jsp").add("act", "Redirect"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.