Jason van Zyl <[EMAIL PROTECTED]> writes:

> On Wed, 2002-03-13 at 02:26, Christian Trutz wrote:
>> In the actual CVS tree there is a incomplete 
>> org.apache.velocity.runtime.compile.Compiler class. This class wants to 
>> compile a template via BCEL. I think it's better to generate first a java 
>> file and then compile this with an usual compiler. What I mean:
>> 
>> 
>> Velocity file:
>> -----------
>> Hello $foo
>> -----------
>> 
>> after "compilation" you get something like this:
>> 
>> ----------------------------------------------------------
>> public class CompiledTemplate {
>> 
>>     public void merge( Context context, Writer writer) {
>>            
>>                 writer.write("Hello ");
>>                 writer.write( context.get( "foo" ) );
>>     }
>> }
>> --------------------------------------------------------
>
> I disagree, you're going to get into all the nasty problems of
> generating source and compiling the sources in your deployed
> environment.

Indeed.  Syntax aside (heh), the compilation phase is one of the
nastiest parts of implementing a JSP engine.  Just look at the JSP
portion of Tomcat for an example (and that's not bad code, either).

- Dan

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to