Package org.apache.velocity.tools.view.context

Examples of org.apache.velocity.tools.view.context.ViewContext


    public @Test void testAddMultiValueParameters()
    {
        HashMap params = new HashMap();
        params.put("a", new String[] { "a", "b", "c" });
        InvocationHandler handler = new ServletAdaptor("/test", params);
        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here


        HashMap params = new HashMap();
        params.put("a", "b");
        params.put("b", "c");
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here

    public @Test void testAddAllParametersFirst()
    {
        HashMap params = new HashMap();
        params.put("a", "b");
        InvocationHandler handler = new ServletAdaptor("/test", params);
        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here

    {
        HashMap params = new HashMap();
        params.put("a", "b");
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);
        link.configure(Collections.singletonMap(LinkTool.AUTO_IGNORE_PARAMETERS_KEY, Boolean.FALSE));
View Full Code Here

    {
        HashMap params = new HashMap();
        params.put("a", "b");
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);
        link.configure(Collections.singletonMap(LinkTool.AUTO_IGNORE_PARAMETERS_KEY, Boolean.FALSE));
View Full Code Here

    {
        HashMap params = new HashMap();
        params.put("a", "b");
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here

    {
        HashMap params = new HashMap();
        params.put("a", new String[] { "a", "b", "c" } );
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here

    {
        HashMap params = new HashMap();
        params.put("a", new String[] { "a", "b", "c" } );
        InvocationHandler handler = new ServletAdaptor("/test", params);

        ViewContext vc = createViewContext(handler);

        LinkTool link = new LinkTool();
        link.init(vc);

        String url = link.setRelative("/target")
View Full Code Here

        if (!(obj instanceof ViewContext))
        {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }

        ViewContext context = (ViewContext)obj;
        this.request = context.getRequest();
        this.response = context.getResponse();
        this.application = context.getServletContext();
        Boolean b = (Boolean)context.getAttribute(ViewContext.XHTML);
        if (b != null)
        {
            setXhtml(b.booleanValue());
        }
    }
View Full Code Here

        if (!(obj instanceof ViewContext))
        {
            throw new IllegalArgumentException("Tool can only be initialized with a ViewContext");
        }

        ViewContext viewContext = (ViewContext)obj;
        this.velocityContext = viewContext.getVelocityContext();
        this.request = viewContext.getRequest();
        this.response = viewContext.getResponse();
        this.application = viewContext.getServletContext();

        if(viewContext.getVelocityEngine().getProperty("eventhandler.methodexception.class") != null) {
          this.methodExceptionHandlerPresent = true;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.view.context.ViewContext

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.