You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Aaron Freeman <aa...@layerz.com> on 2003/07/25 04:07:30 UTC

VelocityView index.vm question

Ok, here's a stupid newbie question.

I have downloaded and installed the VelocityView tools as recommended.  I
placed the simple.war file into my webapps directory and I used the URL:
http://<your_server>:<port>/simple/ as recommended by the documentation.
And the website returned properly.

The question is ... how the heck did the VelocityView servlet (a) get called
in the first place, and (b) know to dump index.vm?  Neither index.vm or
VelocityServlet are part of the URL ... and I don't understand the web.xml
file.

Aaron Freeman
Layer-Z, Inc.
Phone: (316) 729-9968
Fax: (215) 895-9813
aaron@layerz.com
http://www.layerz.com/


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


RE: VelocityView index.vm question

Posted by Aaron Freeman <aa...@layerz.com>.
Ok, very cool.  I think my major problem is that the Jetty docs spend all
the time talking about their classes, but I couldn't find any docs about the
web.xml file.  I think based on your comments I have it all straight now.

Aaron Freeman
Layer-Z, Inc.
Phone: (316) 729-9968
Fax: (215) 895-9813
aaron@layerz.com
http://www.layerz.com/


> -----Original Message-----
> From: Christoph.Reck@dlr.de [mailto:Christoph.Reck@dlr.de]
> Sent: Friday, July 25, 2003 3:25 AM
> To: Velocity Users List
> Subject: Re: VelocityView index.vm question
>
>
> Hi,
>
> Aaron Freeman wrote:
> > Ok, here's a stupid newbie question.
> >
> > I have downloaded and installed the VelocityView tools as
> recommended.  I
> > placed the simple.war file into my webapps directory and I used the URL:
> > http://<your_server>:<port>/simple/ as recommended by the documentation.
> > And the website returned properly.
> >
> > The question is ... how the heck did the VelocityView servlet
> (a) get called
> > in the first place, and (b) know to dump index.vm?  Neither index.vm or
> > VelocityServlet are part of the URL ... and I don't understand
> the web.xml
> > file.
>
> a) This is the magic behind webapps in the servlet spec. Just by
> installing
>     an application in the <tomcatHome>/webapp/<yourApp> it will locate the
>     <tomcatHome>/webapp/<yourApp>/WEB-INF/web.xml and learn all about it.
>
>     Since the simple.war unpacks into the "simple" application, you were
>     able to address it!
>
>     Now look into its web.xml, there is a servlet defined - I let
> you guess
>     how its class is called!
>
> http://cvs.apache.org/viewcvs/jakarta-velocity-tools/examples/simp
> le/WEB-INF/web.xml?rev=HEAD
>
> b) Also in the web.xml there is a welcome-file-list defined. Here you
>     can configure the files that are candidates of the parameterless
>     invocation. For example you could set a "login.vm" in there...
>
>     The servlet specification (PDF downlaoded from SUNs site) states:
>     "If a Web container receives a valid partial request, the Web
> container
>      must examine the welcome file list defined in the deployment
> descriptor."
>
>     VoilĂ : the servlet container will use the stated servlet to process
>     the welcome-file-list file "init.vm".
>
>
> Here is all you ever wanted to know about the web.xml file:
>
> http://developer.java.sun.com/developer/Books/javaserverpages/serv
lets_javaserver/servlets_javaserver05.pdf
To find more about servlets:
   http://www.servlets.com/docs/index.html
   http://java.sun.com/products/servlet/resources.html

Cheers,
Christoph

>
> Aaron Freeman
> Layer-Z, Inc.
> Phone: (316) 729-9968
> Fax: (215) 895-9813
> aaron@layerz.com
> http://www.layerz.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

--
:) Christoph Reck


---------------------------------------------------------------------
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: VelocityView index.vm question

Posted by Ch...@dlr.de.
Hi,

Aaron Freeman wrote:
> Ok, here's a stupid newbie question.
> 
> I have downloaded and installed the VelocityView tools as recommended.  I
> placed the simple.war file into my webapps directory and I used the URL:
> http://<your_server>:<port>/simple/ as recommended by the documentation.
> And the website returned properly.
> 
> The question is ... how the heck did the VelocityView servlet (a) get called
> in the first place, and (b) know to dump index.vm?  Neither index.vm or
> VelocityServlet are part of the URL ... and I don't understand the web.xml
> file.

a) This is the magic behind webapps in the servlet spec. Just by installing
    an application in the <tomcatHome>/webapp/<yourApp> it will locate the
    <tomcatHome>/webapp/<yourApp>/WEB-INF/web.xml and learn all about it.

    Since the simple.war unpacks into the "simple" application, you were
    able to address it!

    Now look into its web.xml, there is a servlet defined - I let you guess
    how its class is called!
    http://cvs.apache.org/viewcvs/jakarta-velocity-tools/examples/simple/WEB-INF/web.xml?rev=HEAD

b) Also in the web.xml there is a welcome-file-list defined. Here you
    can configure the files that are candidates of the parameterless
    invocation. For example you could set a "login.vm" in there...

    The servlet specification (PDF downlaoded from SUNs site) states:
    "If a Web container receives a valid partial request, the Web container
     must examine the welcome file list defined in the deployment descriptor."

    VoilĂ : the servlet container will use the stated servlet to process
    the welcome-file-list file "init.vm".


Here is all you ever wanted to know about the web.xml file:
   http://developer.java.sun.com/developer/Books/javaserverpages/servlets_javaserver/servlets_javaserver05.pdf
To find more about servlets:
   http://www.servlets.com/docs/index.html
   http://java.sun.com/products/servlet/resources.html

Cheers,
Christoph

> 
> Aaron Freeman
> Layer-Z, Inc.
> Phone: (316) 729-9968
> Fax: (215) 895-9813
> aaron@layerz.com
> http://www.layerz.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

-- 
:) Christoph Reck


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


RE: VelocityView index.vm question

Posted by Aaron Freeman <aa...@layerz.com>.
OK, actually I am not new to servlets at all.  I used to use them before the
official servlet spec came out back when the only server around was Acme.  I
know the servlet servers have evolved a lot since I used to use them but I
had a hard time finding documentation on the new "lay of the land" for these
buggers.

Thanks for the tip!

Aaron Freeman
Layer-Z, Inc.
Phone: (316) 729-9968
Fax: (215) 895-9813
aaron@layerz.com
http://www.layerz.com/


> -----Original Message-----
> From: Nathan Bubna [mailto:nathan@esha.com]
> Sent: Thursday, July 24, 2003 10:51 PM
> To: Velocity Users List
> Subject: Re: VelocityView index.vm question
>
>
> Aaron Freeman said:
> > Ok, here's a stupid^H^H^H^H^H^Hignorant newbie question.
> >
> > I have downloaded and installed the VelocityView tools as
> recommended.  I
> > placed the simple.war file into my webapps directory and I used the URL:
> > http://<your_server>:<port>/simple/ as recommended by the documentation.
> > And the website returned properly.
>
> glad to hear it. :)
>
> > The question is ... how the heck did the VelocityView servlet
> (a) get called
> > in the first place, and (b) know to dump index.vm?  Neither index.vm or
> > VelocityServlet are part of the URL ... and I don't understand
> the web.xml
> > file.
>
> the web.xml is at the center of it all.  :)  this is really a
> newbie question
> about servlets in general and not velocity, so i'm not about to
> explain this
> all here.   but i'll give you a link to one of the hundreds of docs on the
> internet that could help you here:
>
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html
>
> have fun! :)
>
> Nathan Bubna
> nathan@esha.com
>
>
> ---------------------------------------------------------------------
> 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: [VELTOOLS] log4j in build.xml

Posted by Nathan Bubna <na...@esha.com>.
Tim Colson said:
> Say Nathan -
>   FYI - I noticed that the ant build complained that ${log4j.jar} is
> used under the simple example, but is undefined.

oops.  ok, just fixed it.

i was testing the new commons-logging/LogSystem bridge using the simple
example and log4j.  didn't mean to commit that.  oh, and this stuff is better
reported on the developer list.  :)

Nathan Bubna
nathan@esha.com



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


[VELTOOLS] log4j in build.xml

Posted by Tim Colson <tc...@cisco.com>.
Say Nathan -
  FYI - I noticed that the ant build complained that ${log4j.jar} is
used under the simple example, but is undefined. 

Timo


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


Re: VelocityView index.vm question

Posted by Nathan Bubna <na...@esha.com>.
Aaron Freeman said:
> Ok, here's a stupid^H^H^H^H^H^Hignorant newbie question.
>
> I have downloaded and installed the VelocityView tools as recommended.  I
> placed the simple.war file into my webapps directory and I used the URL:
> http://<your_server>:<port>/simple/ as recommended by the documentation.
> And the website returned properly.

glad to hear it. :)

> The question is ... how the heck did the VelocityView servlet (a) get called
> in the first place, and (b) know to dump index.vm?  Neither index.vm or
> VelocityServlet are part of the URL ... and I don't understand the web.xml
> file.

the web.xml is at the center of it all.  :)  this is really a newbie question
about servlets in general and not velocity, so i'm not about to explain this
all here.   but i'll give you a link to one of the hundreds of docs on the
internet that could help you here:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/index.html

have fun! :)

Nathan Bubna
nathan@esha.com


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