Examples of attachToContext()


Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

    if (util instanceof EventHandler)
    {
      EventCartridge ec = new EventCartridge();
      ec.addEventHandler(util);
      ec.attachToContext(cx);
    }
    cx.put(UTIL_KEY, util);
    return cx;
  }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

        // 将event cartridge复制以后(如有必要)附到context中。
        EventCartridge ec = configuration.getEventCartridge().getRuntimeInstance();

        if (ec != null) {
            assertTrue(ec.attachToContext(eventContext), "Could not attach EventCartridge to velocity context");
        }

        return eventContext;
    }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

        // ��event cartridge�����Ժ����б�Ҫ������context�С�
        EventCartridge ec = configuration.getEventCartridge().getRuntimeInstance();

        if (ec != null) {
            assertTrue(ec.attachToContext(eventContext), "Could not attach EventCartridge to velocity context");
        }

        return eventContext;
    }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

        ve.init();

        VelocityContext context = new VelocityContext();
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(reporter);
        ec.attachToContext(context);

        context.put("a1","test");
        context.put("b1","test");
        Writer writer = new StringWriter();
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

        ve.init();

        VelocityContext context = new VelocityContext();
        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(reporter);
        ec.attachToContext(context);

        context.put("a1","test");
        context.put("b1","test");
        Writer writer = new StringWriter();
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

            public boolean internalContainsKey(Object key) {
                return descriptorProps.containsKey(key) || props.containsKey(key);
            }
        };

        eventCartridge.attachToContext(context); // ����ʹ��${a.b.c}
        context.put("D", "$"); // ������${D}������$

        return context;
    }
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

         *  Context
         */

        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext( context );
 
        try
        {
            /*
             *  lets test each type of event handler individually
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

             *  event cartridge stuff
             */

            EventCartridge ec = new EventCartridge();
            ec.addEventHandler(this);
            ec.attachToContext( context );

            /*
             *  make a writer, and merge the template 'against' the context
             */

 
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

         *  Context
         */

        EventCartridge ec = new EventCartridge();
        ec.addEventHandler(this);
        ec.attachToContext( inner );
 
        /*
         *  now wrap the event cartridge - we want to make sure that
         *  we can do this w/o harm
         */
 
View Full Code Here

Examples of org.apache.velocity.app.event.EventCartridge.attachToContext()

                // build the HTML body
                vt = velocityEngine.getTemplate(template.getHtmlBodyTemplateResourcePath());
                // HTML-escape all content inserted
                EventCartridge ec = new EventCartridge();
                ec.addEventHandler(new EscapeHtmlReference());
                ec.attachToContext(velocityContext);
                writer.getBuffer().setLength(0);
                vt.merge(velocityContext, writer);
                emailerFactory.setHtmlBody(response, writer.toString());
            }
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.