As noted on the wiki page, this custom resource loader extends WebappResourceLoader but you can do exactly the same while extending FileResourceLoader.

If you do so, be sure to share it! Also, the code could probably be optimized a bit (for instance by using a StringBuilder instead of a String for its inner buffer).


  Claude

On 2011-03-23 10:47, Jean-Baptiste BRIAUD -- Novlog wrote:
It doesn't compile :
the WebappResourceLoader class is not found.
I guess it is in the velocity-tool.jar extra lib ... I'll try, I have several 
emergency in parallel :-)
If my guess is correct, I'll just have to add a new dependency on my project.
I'll let you know.

On 22 mars 2011, at 17:20, Claude Brisson wrote:

It's a very straightforward input filter that uses the common resource loading 
API - it should work well with 1.7.

It's the filter itself that should be considered beta.

Claude

On 2011-03-22 14:33, Jean-Baptiste BRIAUD -- Novlog wrote:
Does it work with current 1.7 (latest stable) version or should I migrate to V2 
beta ?
If yes, is that beta version stable enough ?

On 22 mars 2011, at 11:41, Jean-Baptiste BRIAUD -- Novlog wrote:

Thanks for the pointer ! For years, I was thinking it was not possible.

On 21 mars 2011, at 20:52, Claude Brisson wrote:

Yet, you can check a custom resource loader available on the wiki that does 
precisely this:
http://wiki.apache.org/velocity/StructuredGlobbingResourceLoader


Claude

On 2011-03-21 19:50, Sergiu Dumitriu wrote:
On 03/21/2011 07:04 PM, Rich Wagner wrote:
Sorry in advance if this is a FAQ whose answer I haven't found...

Instead of writing:


#foreach( $container in $Containers )
#if( $container.prop("Generate") )
    ...stuff...
#end
#end


I'd like to indent the "#if" and its "#end", for the sake of better readability:


#foreach( $container in $Containers )
    #if( $container.prop("Generate") )
    ...stuff...
    #end
#end


But then I find the spaces before the "#if" and its matching "#end" show up in 
the output, which I don't want to happen.

To get around this, I've implemented a somewhat hack-ish Template preprocesser:  my resource 
loader wraps a template's stream inside my own stream implementation which filters template 
lines.  That is, if a line starts with "<white-space>#blah", the initial spaces 
are trimmed off.

That works, and isn't all that intrusive.  But if "off-the-shelf" Velocity 
already provides an easier way to accomplish the same thing, I'd prefer that...
No, there's no similar feature directly in Velocity yet.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to