You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Ross Tailby <Ro...@antech.org.uk> on 2003/10/15 18:37:29 UTC

Velocity configuration with servlets

I am currently having a problem displaying output on a web browser when
using Velocity with Servlets. The tomcat server and directory structure seem
to be set up ok as standard Servlets will appear fine. However, when a
Servlet that uses a velocity template is used, no output is displayed (i.e.
blank IE screen) and a
org.apache.velocity.exception.ResourceNotFoundException appears in the
tomcat command window (stating that the resource velocity template cannot be
found). 

I realise that this probably means that the template is not located by the
program but I've tried specifying the path in the servlet, pasting the
template in at every level in the directory path, and defining a
"velocity.properties" config file (which didn't seem to do very much..) all
to no avail. If anyone has some advice on how to structure the directory or
if any extra settings need to be changed, I'd be very grateful to hear about
it. 

Thanks.

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


Re: Velocity configuration with servlets

Posted by Barbara Baughman <ba...@utdallas.edu>.
Actually, I was referring to Velocity.  I've used Jetty, and I like it
also.

Barbara Baughman
X2157

On Mon, 20 Oct 2003, Geir Magnusson Jr. wrote:

>
> On Wednesday, October 15, 2003, at 01:19 PM, Barbara Baughman wrote:
>
> > Without the steps to specifically set the file.resource.loader.path to
> > be relative to the web application, Velocity always looks for the
> > templates relative to the directory where the program is running.  For
> > tomcat, that's relative to $TOMCAT_HOME/bin.
> >
> > The VelocityViewServlet in the Velocity Tools project can be a help in
> > using Velocity within the context of servlet development.
> >
> > For another perspective, I have my personal notes on setting up
> > Velocity with tomcat at
> > http://www.utdallas.edu/~baughman/velocity2.html
> >
> > After you get it working once, you'll never want to use anything else.
> >
>
> Well, Jetty ain't bad either :)
>
> > Barbara Baughman
> > X2157
> >
> > On Wed, 15 Oct 2003, Ross Tailby wrote:
> >
> >> I am currently having a problem displaying output on a web browser
> >> when
> >> using Velocity with Servlets. The tomcat server and directory
> >> structure seem
> >> to be set up ok as standard Servlets will appear fine. However, when a
> >> Servlet that uses a velocity template is used, no output is displayed
> >> (i.e.
> >> blank IE screen) and a
> >> org.apache.velocity.exception.ResourceNotFoundException appears in the
> >> tomcat command window (stating that the resource velocity template
> >> cannot be
> >> found).
> >>
> >> I realise that this probably means that the template is not located
> >> by the
> >> program but I've tried specifying the path in the servlet, pasting the
> >> template in at every level in the directory path, and defining a
> >> "velocity.properties" config file (which didn't seem to do very
> >> much..) all
> >> to no avail. If anyone has some advice on how to structure the
> >> directory or
> >> if any extra settings need to be changed, I'd be very grateful to
> >> hear about
> >> it.
> >>
> >> Thanks.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
> --
> Geir Magnusson Jr                                   203-247-1713(m)
> geirm@optonline.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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


Re: Velocity configuration with servlets

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Wednesday, October 15, 2003, at 01:19 PM, Barbara Baughman wrote:

> Without the steps to specifically set the file.resource.loader.path to
> be relative to the web application, Velocity always looks for the
> templates relative to the directory where the program is running.  For
> tomcat, that's relative to $TOMCAT_HOME/bin.
>
> The VelocityViewServlet in the Velocity Tools project can be a help in
> using Velocity within the context of servlet development.
>
> For another perspective, I have my personal notes on setting up
> Velocity with tomcat at
> http://www.utdallas.edu/~baughman/velocity2.html
>
> After you get it working once, you'll never want to use anything else.
>

Well, Jetty ain't bad either :)

> Barbara Baughman
> X2157
>
> On Wed, 15 Oct 2003, Ross Tailby wrote:
>
>> I am currently having a problem displaying output on a web browser 
>> when
>> using Velocity with Servlets. The tomcat server and directory 
>> structure seem
>> to be set up ok as standard Servlets will appear fine. However, when a
>> Servlet that uses a velocity template is used, no output is displayed 
>> (i.e.
>> blank IE screen) and a
>> org.apache.velocity.exception.ResourceNotFoundException appears in the
>> tomcat command window (stating that the resource velocity template 
>> cannot be
>> found).
>>
>> I realise that this probably means that the template is not located 
>> by the
>> program but I've tried specifying the path in the servlet, pasting the
>> template in at every level in the directory path, and defining a
>> "velocity.properties" config file (which didn't seem to do very 
>> much..) all
>> to no avail. If anyone has some advice on how to structure the 
>> directory or
>> if any extra settings need to be changed, I'd be very grateful to 
>> hear about
>> it.
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


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


Re: Velocity configuration with servlets

Posted by Barbara Baughman <ba...@utdallas.edu>.
Without the steps to specifically set the file.resource.loader.path to
be relative to the web application, Velocity always looks for the
templates relative to the directory where the program is running.  For
tomcat, that's relative to $TOMCAT_HOME/bin.

The VelocityViewServlet in the Velocity Tools project can be a help in
using Velocity within the context of servlet development.

For another perspective, I have my personal notes on setting up
Velocity with tomcat at
http://www.utdallas.edu/~baughman/velocity2.html

After you get it working once, you'll never want to use anything else.

Barbara Baughman
X2157

On Wed, 15 Oct 2003, Ross Tailby wrote:

> I am currently having a problem displaying output on a web browser when
> using Velocity with Servlets. The tomcat server and directory structure seem
> to be set up ok as standard Servlets will appear fine. However, when a
> Servlet that uses a velocity template is used, no output is displayed (i.e.
> blank IE screen) and a
> org.apache.velocity.exception.ResourceNotFoundException appears in the
> tomcat command window (stating that the resource velocity template cannot be
> found).
>
> I realise that this probably means that the template is not located by the
> program but I've tried specifying the path in the servlet, pasting the
> template in at every level in the directory path, and defining a
> "velocity.properties" config file (which didn't seem to do very much..) all
> to no avail. If anyone has some advice on how to structure the directory or
> if any extra settings need to be changed, I'd be very grateful to hear about
> it.
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

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