You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Li Xiaoli-a17351 <a1...@motorola.com> on 2001/05/08 06:33:31 UTC

2 simple questions

Hi all

I'm a new guy here, I know few about velocity. So I have 2 simple questions:

1. How to make VTL work? 
I download velocity, and build successfully. then I create an HTML file with the following code
   
 html>
<body>
#set( $foo = "Velocity" )
Hello $foo World!
</body>
<html>
  but when I view it in IE, it shows  #set($foo = "Velocity" ) Hello $foo World!, rather than Hello Velocity World.

2. For those examples, such as example1, I can only view the result by executing example1.bat, How can I apply it to my web site?


Thanks a lot for your help!

Xiaoli
 

Re: 2 simple questions

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Li Xiaoli-a17351 wrote:
> 
> Hi all
> 
> I'm a new guy here, I know few about velocity. So I have 2 simple questions:
> 
> 1. How to make VTL work?
> I download velocity, and build successfully. then I create an HTML file with the following code
> 
>  html>
> <body>
> #set( $foo = "Velocity" )
> Hello $foo World!
> </body>
> <html>
>   but when I view it in IE, it shows  #set($foo = "Velocity" ) Hello $foo World!, rather than Hello Velocity World.

When you add velocity code to an HTML file, we call that a Velocity
template.  These templates need to be processed by the Velocity template
engine.  For web based work, you need to work with a servlet engine like
tomcat for this to happen.  Do this :

1) Go to Tomcat's web page http://jakarta.apache.org/tomcat/index.html
and read about it.

2) Download jakarta-tomcat-3.2.1.tgz from

  http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.1/bin/

3) Install and test.  The tomcat documentation is pretty good, and there
is a large user community - so any problems you have should be quickly
answered by them.  The mailing list you would want for that is
tomcat-dev (http://jakarta.apache.org/site/mail.html and follow the
directions.)

4) Once you have tomcat installed and working, you will need to make a
servlet for use by tomcat. In velocity, build the servlet example by
typing
   
    build/build.sh examples

and then go look in the examples/servlet_example1 directory.

5) To install this servlet :

  * Note : the following only applies to tomcat and I am just making
this up as I go along, so there may be a few problems - I will make sure
it's right, and then add these instructions to the documentation along
with a complete WAR somewhere if I remember

  ** Note : to make this easier, I modified the
examples/servlet_example1/SampleServlet.java code to be self configuring
re the webapp root for finding templates and putting the log file, so
please get the latest copy from CVS

 - make a new 'webapp' : under tomcat's webapps directory, make a new
directory structure
   webapp/
      velexample
      velexample/WEB-INF
      velexample/WEB-INF/lib
      velexample/WEB-INF/classes

 - put the velocity-1.0.1.jar (or newer) into the velexample/WEB-INF/lib
directory
 
 - put the SampleServlet.class into the velexample/WEB-INF/classes
directory

 - put the sample.vm template into the velexample directory.

 - at this point, you should be able to restart tomcat and access the
servlet.  

 - so bounce tomcat, go into your web brower and go to : 

    http://<your computer's ip
address>:8080/velexample/servlet/SampleServlet

 - you should see the sample output.  At the least, a file
'velocity.log' should be created in the velexample directory

At this point, you are using Velocity!

So - make sure you update the SampleServlet.java code before doing this.

geir


> 2. For those examples, such as example1, I can only view the result by executing example1.bat, How can I apply it to my web site?
> 
> Thanks a lot for your help!
> 
> Xiaoli
> 

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."

Re: Integration with Tomcat

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Alin Simionoiu wrote:
> 
> I put the template in velexample directory.
> Velocity Log file say  :
> Tue May 08 11:12:36 PDT 2001 AvalonLogSystem initialized using logfile
> C:\Apache\Tomcat\bin\velocity.log
> Tue May 08 11:12:36 PDT 2001   [info]   [info] Default Properties File:
> org\apache\velocity\runtime\defaults\velocity.properties
> Tue May 08 11:12:36 PDT 2001   [info] Resource Loader Instantiated:
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : initialization
> starting.
> Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : adding path '.'
> Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : initialization
> complete.
> Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Literal
> Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Macro
> Tue May 08 11:12:36 PDT 2001
> info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Parse
> Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Include
> Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
> org.apache.velocity.runtime.directive.Foreach
> Tue May 08 11:12:36 PDT 2001   [info] Created: 20 parsers.
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : initialization starting.
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : adding VMs from VM
> library template : VM_global_library.vm
> Tue May 08 11:12:36 PDT 2001  [error] ResourceManager : unable to find
> resource 'VM_global_library.vm' in any resource loader.
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : error using  VM library
> template VM_global_library.vm :
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'VM_global_library.vm'
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInline = true : VMs
> can be defined inline in templates
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInlineToOverride =
> false : VMs defined inline may NOT replace previous VM definitions
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInlineLocal = false
> : VMs defined inline will be  global in scope if allowed.
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : messages on  : VM system
> will output logging messages
> Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : initialization complete.
> Tue May 08 11:12:36 PDT 2001   [info] Velocity successfully started.
> Tue May 08 11:12:36 PDT 2001  [error] ResourceManager : unable to find
> resource 'sample.vm' in any resource loader.
> Tue May 08 11:12:57 PDT 2001  [error] ResourceManager : unable to find
> resource 'sample.vm' in any resource loader.
> Tue May 08 11:30:18 PDT 2001  [error] ResourceManager : unable to find
> resource 'sample.vm' in any resource loader.
> 
> I find very interesting this line:
> Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : adding path '.'
> It's seems that the current directory for velocity is tomcat/bin ...wright?
> More corect to say : is the directory from where tomcat is started.
> 
> It is possible to specify a path to FileResourceLoader?...

Yes - the servlet example was changed about 2 weeks ago to automatically
configure the FileResourceLoader to use the webapp root as the path for
finding templates.  This is confirmed to work in Tomcat.  Please update
your servlet example

  examples/servlet_example/SampleServlet.java

and then rebuild the examples, move the .class file to the
WEB-INF/classes directory of your webapp, and try again.
 
> I found that Velocity parameter file in wright in the jar file. Corect ?

Yes, but you don't want to modify that.  Those are defaults for Velocity
to use.

geir 



-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."

Re: Integration with Tomcat

Posted by Alin Simionoiu <as...@musicnet.com>.
I put the template in velexample directory.
Velocity Log file say  :
Tue May 08 11:12:36 PDT 2001 AvalonLogSystem initialized using logfile
C:\Apache\Tomcat\bin\velocity.log
Tue May 08 11:12:36 PDT 2001   [info]   [info] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties
Tue May 08 11:12:36 PDT 2001   [info] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : initialization
starting.
Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : adding path '.'
Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : initialization
complete.
Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Literal
Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Macro
Tue May 08 11:12:36 PDT 2001
info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Parse
Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Include
Tue May 08 11:12:36 PDT 2001   [info] Loaded Pluggable Directive:
org.apache.velocity.runtime.directive.Foreach
Tue May 08 11:12:36 PDT 2001   [info] Created: 20 parsers.
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : initialization starting.
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : adding VMs from VM
library template : VM_global_library.vm
Tue May 08 11:12:36 PDT 2001  [error] ResourceManager : unable to find
resource 'VM_global_library.vm' in any resource loader.
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : error using  VM library
template VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'VM_global_library.vm'
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInline = true : VMs
can be defined inline in templates
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInlineToOverride =
false : VMs defined inline may NOT replace previous VM definitions
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : allowInlineLocal = false
: VMs defined inline will be  global in scope if allowed.
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : messages on  : VM system
will output logging messages
Tue May 08 11:12:36 PDT 2001   [info] Velocimacro : initialization complete.
Tue May 08 11:12:36 PDT 2001   [info] Velocity successfully started.
Tue May 08 11:12:36 PDT 2001  [error] ResourceManager : unable to find
resource 'sample.vm' in any resource loader.
Tue May 08 11:12:57 PDT 2001  [error] ResourceManager : unable to find
resource 'sample.vm' in any resource loader.
Tue May 08 11:30:18 PDT 2001  [error] ResourceManager : unable to find
resource 'sample.vm' in any resource loader.

I find very interesting this line:
Tue May 08 11:12:36 PDT 2001   [info] FileResourceLoader : adding path '.'
It's seems that the current directory for velocity is tomcat/bin ...wright?
More corect to say : is the directory from where tomcat is started.

It is possible to specify a path to FileResourceLoader?...

I found that Velocity parameter file in wright in the jar file. Corect ?



----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Tuesday, May 08, 2001 3:28 PM
Subject: Re: Integration with Tomcat


> Alin Simionoiu wrote:
> >
> > Thank a lot for you're help.
> > Now it's starting to make sense to me how Velocity can be integrated
with
> > Tomcat.
> >
> > But, I think your REAMDE.txt file is not very correct.
> > You say that it's necessary to create a new webapp directory under
existent
> > webapps directory.
> > An create that structure under this new webapp directory.
> > If I do this, Tomcat will reply with 404 Not Found, which I think is
> > correct.
>
> Ah yes.  Of course.  I was hoping that would be clear.  I will emphasize
> that in the README / folloup docs.  Thanks.
>
> > On the other hand, I create that directory structure ( velexample...)
> > directly under tomcat webapps it's seems that's working.
> > But, It doesn't find the template file.
> > The error is :
>
> Ah - but we at least have made the first steps and gotten tomcat up and
> running, a servlet built, velocity's jar found.
>
> Where did you put the template, and can you tell me what the
> velocity.log said?
>
> geir
>
> >
> > VelocityServlet : Error processing the template
> > java.lang.Exception: Cannot find the template!
> > java.lang.Exception: Cannot find the template! at
> >
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> > 34) at
> >
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:287)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at
> > org.apache.tomcat.core.Handler.service(Handler.java:286) at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
> >
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> > 7) at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > at
> >
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> > onnectionHandler.java:210) at
> >
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
> >
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > at java.lang.Thread.run(Thread.java:484)
> >
> > P.S
> > I bounce Tomcat after I create the directory structure.
> >
> > alin
> >
> > ----- Original Message -----
> > From: "Geir Magnusson Jr." <ge...@optonline.net>
> > To: <ve...@jakarta.apache.org>
> > Sent: Tuesday, May 08, 2001 5:24 AM
> > Subject: Re: Integration with Tomcat
> >
> > > Alin Simionoiu wrote:
> > > >
> > > > I read in the Readme file that Velocity can be integrated with
Tomcat.
> > > > But I cannot find any documentation how actually you can do that.
> > > > Can somebody please help me ?
> > > >
> > > > Alin
> > >
> > >
> > > I just updated the examples/servlet_example1 code and README.txt,
which
> > > should be a nice simple sketch on doing the very basics.  You will
have
> > > to get this out of CVS, on the main branch.  It's simple to do - you
can
> > > use your web browser and download the parts.
> > >
> > > Just go to
> > >
> > >   http://jakarta.apache.org/cvsweb/index.cgi/jakarta-velocity/
> > >
> > > Tell us what happens...
> > >
> > > geir
> > >
> > > --
> > > Geir Magnusson Jr.                           geirm@optonline.net
> > > System and Software Consulting
> > > Developing for the web?  See http://jakarta.apache.org/velocity/
> > > "still climbing up to the shoulders..."
> > >
>
> --
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> "still climbing up to the shoulders..."
>


Re: Integration with Tomcat

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Alin Simionoiu wrote:
> 
> Thank a lot for you're help.
> Now it's starting to make sense to me how Velocity can be integrated with
> Tomcat.
> 
> But, I think your REAMDE.txt file is not very correct.
> You say that it's necessary to create a new webapp directory under existent
> webapps directory.
> An create that structure under this new webapp directory.
> If I do this, Tomcat will reply with 404 Not Found, which I think is
> correct.

Ah yes.  Of course.  I was hoping that would be clear.  I will emphasize
that in the README / folloup docs.  Thanks.

> On the other hand, I create that directory structure ( velexample...)
> directly under tomcat webapps it's seems that's working.
> But, It doesn't find the template file.
> The error is :

Ah - but we at least have made the first steps and gotten tomcat up and
running, a servlet built, velocity's jar found.

Where did you put the template, and can you tell me what the
velocity.log said?

geir

> 
> VelocityServlet : Error processing the template
> java.lang.Exception: Cannot find the template!
> java.lang.Exception: Cannot find the template! at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 34) at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:287)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at
> org.apache.tomcat.core.Handler.service(Handler.java:286) at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:210) at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
> 
> P.S
> I bounce Tomcat after I create the directory structure.
> 
> alin
> 
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: <ve...@jakarta.apache.org>
> Sent: Tuesday, May 08, 2001 5:24 AM
> Subject: Re: Integration with Tomcat
> 
> > Alin Simionoiu wrote:
> > >
> > > I read in the Readme file that Velocity can be integrated with Tomcat.
> > > But I cannot find any documentation how actually you can do that.
> > > Can somebody please help me ?
> > >
> > > Alin
> >
> >
> > I just updated the examples/servlet_example1 code and README.txt, which
> > should be a nice simple sketch on doing the very basics.  You will have
> > to get this out of CVS, on the main branch.  It's simple to do - you can
> > use your web browser and download the parts.
> >
> > Just go to
> >
> >   http://jakarta.apache.org/cvsweb/index.cgi/jakarta-velocity/
> >
> > Tell us what happens...
> >
> > geir
> >
> > --
> > Geir Magnusson Jr.                           geirm@optonline.net
> > System and Software Consulting
> > Developing for the web?  See http://jakarta.apache.org/velocity/
> > "still climbing up to the shoulders..."
> >

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."

RE: Integration with Tomcat

Posted by David Duddleston <da...@i2a.com>.
Is the sample.vm file at the root of the velexample dir.

..../tomcat/webapps/velexample/sample.vm

-david

> -----Original Message-----
> From: Alin Simionoiu [mailto:asimionoiu@musicnet.com]
> Sent: Tuesday, May 08, 2001 11:01 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Integration with Tomcat
>
>
> Thank a lot for you're help.
> Now it's starting to make sense to me how Velocity can be integrated with
> Tomcat.
>
> But, I think your REAMDE.txt file is not very correct.
> You say that it's necessary to create a new webapp directory
> under existent
> webapps directory.
> An create that structure under this new webapp directory.
> If I do this, Tomcat will reply with 404 Not Found, which I think is
> correct.
>
> On the other hand, I create that directory structure ( velexample...)
> directly under tomcat webapps it's seems that's working.
> But, It doesn't find the template file.
> The error is :
>
> VelocityServlet : Error processing the template
> java.lang.Exception: Cannot find the template!
> java.lang.Exception: Cannot find the template! at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServ
> let.java:3
> 34) at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.
> java:287)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.jav
> a:404) at
> org.apache.tomcat.core.Handler.service(Handler.java:286) at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
> org.apache.tomcat.core.ContextManager.internalService(ContextManag
> er.java:79
> 7) at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> tion(HttpC
> onnectionHandler.java:210) at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.ja
> va:416) at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> at java.lang.Thread.run(Thread.java:484)
>
> P.S
> I bounce Tomcat after I create the directory structure.
>
> alin
>
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: <ve...@jakarta.apache.org>
> Sent: Tuesday, May 08, 2001 5:24 AM
> Subject: Re: Integration with Tomcat
>
>
> > Alin Simionoiu wrote:
> > >
> > > I read in the Readme file that Velocity can be integrated with Tomcat.
> > > But I cannot find any documentation how actually you can do that.
> > > Can somebody please help me ?
> > >
> > > Alin
> >
> >
> > I just updated the examples/servlet_example1 code and README.txt, which
> > should be a nice simple sketch on doing the very basics.  You will have
> > to get this out of CVS, on the main branch.  It's simple to do - you can
> > use your web browser and download the parts.
> >
> > Just go to
> >
> >   http://jakarta.apache.org/cvsweb/index.cgi/jakarta-velocity/
> >
> > Tell us what happens...
> >
> > geir
> >
> > --
> > Geir Magnusson Jr.                           geirm@optonline.net
> > System and Software Consulting
> > Developing for the web?  See http://jakarta.apache.org/velocity/
> > "still climbing up to the shoulders..."
> >


Re: Integration with Tomcat

Posted by Alin Simionoiu <as...@musicnet.com>.
Thank a lot for you're help.
Now it's starting to make sense to me how Velocity can be integrated with
Tomcat.

But, I think your REAMDE.txt file is not very correct.
You say that it's necessary to create a new webapp directory under existent
webapps directory.
An create that structure under this new webapp directory.
If I do this, Tomcat will reply with 404 Not Found, which I think is
correct.

On the other hand, I create that directory structure ( velexample...)
directly under tomcat webapps it's seems that's working.
But, It doesn't find the template file.
The error is :

VelocityServlet : Error processing the template
java.lang.Exception: Cannot find the template!
java.lang.Exception: Cannot find the template! at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
34) at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at
org.apache.tomcat.core.Handler.service(Handler.java:286) at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210) at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

P.S
I bounce Tomcat after I create the directory structure.

alin

----- Original Message -----
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: <ve...@jakarta.apache.org>
Sent: Tuesday, May 08, 2001 5:24 AM
Subject: Re: Integration with Tomcat


> Alin Simionoiu wrote:
> >
> > I read in the Readme file that Velocity can be integrated with Tomcat.
> > But I cannot find any documentation how actually you can do that.
> > Can somebody please help me ?
> >
> > Alin
>
>
> I just updated the examples/servlet_example1 code and README.txt, which
> should be a nice simple sketch on doing the very basics.  You will have
> to get this out of CVS, on the main branch.  It's simple to do - you can
> use your web browser and download the parts.
>
> Just go to
>
>   http://jakarta.apache.org/cvsweb/index.cgi/jakarta-velocity/
>
> Tell us what happens...
>
> geir
>
> --
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> "still climbing up to the shoulders..."
>


Re: Integration with Tomcat

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Alin Simionoiu wrote:
> 
> I read in the Readme file that Velocity can be integrated with Tomcat.
> But I cannot find any documentation how actually you can do that.
> Can somebody please help me ?
> 
> Alin


I just updated the examples/servlet_example1 code and README.txt, which
should be a nice simple sketch on doing the very basics.  You will have
to get this out of CVS, on the main branch.  It's simple to do - you can
use your web browser and download the parts.

Just go to 

  http://jakarta.apache.org/cvsweb/index.cgi/jakarta-velocity/

Tell us what happens...

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."

Re: Integration with Tomcat

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/7/01 9:49 PM, "Alin Simionoiu" <as...@musicnet.com> wrote:

> I read in the Readme file that Velocity can be integrated with Tomcat.
> But I cannot find any documentation how actually you can do that.
> Can somebody please help me ?
> 
> Alin

Look at the website and the examples.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>


Integration with Tomcat

Posted by Alin Simionoiu <as...@musicnet.com>.
I read in the Readme file that Velocity can be integrated with Tomcat.
But I cannot find any documentation how actually you can do that.
Can somebody please help me ?

Alin


Re: 2 simple questions

Posted by Jon Stevens <jo...@latchkey.com>.
on 5/7/01 9:33 PM, "Li Xiaoli-a17351" <a1...@motorola.com> wrote:

> Hi all
> 
> I'm a new guy here, I know few about velocity. So I have 2 simple questions:
> 
> 1. How to make VTL work?
> I download velocity, and build successfully. then I create an HTML file with
> the following code
>  
> html>
> <body>
> #set( $foo = "Velocity" )
> Hello $foo World!
> </body>
> <html>
> but when I view it in IE, it shows  #set($foo = "Velocity" ) Hello $foo
> World!, rather than Hello Velocity World.

We already answered this question for you last week.

You need to use a servlet engine.

> 2. For those examples, such as example1, I can only view the result by
> executing example1.bat, How can I apply it to my web site?

Look at the Servlet examples.

-jon

-- 
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>