Okay, I wrote too soon. I now see the escape tool and its hash method in tools 1.4. My bad.

I still don't understand what, if anything, I need to do to configure my application to use it. My present configuation is done entirely in Java:

private void init(ServletContext ctx) throws VelocityInitializationException { this.engine.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
         "org.apache.velocity.runtime.log.Log4JLogChute" );

       this.engine.setProperty("runtime.log.logsystem.log4j.logger",
                       "Velocity");
this.engine.setProperty("velocimacro.library", "/resources/VM_global_library.vm"); this.engine.setProperty("resource.loader", "webapp");
       this.engine.setProperty("webapp.resource.loader.class",
               "org.apache.velocity.tools.view.servlet.WebappLoader");

this.engine.setApplicationAttribute("javax.servlet.ServletContext", ctx);


       try {
           this.engine.init();
       } catch (Exception e) {
           throw new VelocityInitializationException(e);  // my own class
       }
       logHelper.info("following is initialization output from velocity");
}

I assume my configuration information would go in here somewhere, but I'm not sure where, or if anything is necessary.

Is something necessary, or, assuming velocity-tools-1.4.jar is in WEB-INF/lib, can I just start using $esc.hash without any other configuration?

Steve Cohen wrote:
Also, the Tools 2.0 documentation seems written from the point of view that you're upgrading from Tools 1.4. Since I don't currently configure or use the Tools, I seem to be missing some key concepts. I can't find the Tools 1.4 documentation.

Steve Cohen wrote:
Thanks. This sounds like the right way to go, yet I currently have a nice simple configuration based on 1.4. The $esc.hash seems to be a 2.0 thing. I don't use the tools now and it seems like a fairly heavy-duty upgrade to fix such a small problem, involving configuration files, etc. that I don't require now. Is there another solution that lies within the framework of Velocity itself?

Jason Tesser wrote:
I would use the ecsapetool

Thanks,
Jason Tesser
dotCMS Lead Development Manager
1-305-858-1422


On Mon, Jul 20, 2009 at 3:07 PM, Steve Cohen <sco...@javactivity.org> wrote:

Using Velocity 1.6.2 I wish to output the string "#####".
In my template, I code it "\#\#\#\#\#"
It renders as \#\#\#\#\#.

What am I doing wrong?  Or how can I make it do what I want?

Steve Cohen

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org

Reply via email to