You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Barbara Baughman <ba...@utdallas.edu> on 2001/07/18 23:12:52 UTC

Default relative path

Thank goodness I was on vacation when all the nastiness was going on.  I
personally have nothing but praise for the folks who brought us Velocity,
maintain and improve it, document it, and spend time helping us
out, for free.  Talk about biting the hand...

That being said, the setup of the relative path for Velocity Servlet is
not intuitive and difficult for newbies.  May I make a suggestion? (you
can disagree and I won't feel badly)

Could the loadConfiguration method of VelocityServlet make webapps/appname
the directory where files will be found?  If this is a servlet, then I'm
thinking the users will be usually be using a servlet engine that follows
the servlet API, and the users will have planned to have their application
files somewhere under webapps/appname.  So the novice can place
velocity.properties and hello.vm under webapps/appname, the Hello World
servlet in WEB-INF/classes, and the example works.  That's more intuitive
to me.

This would involve taking the code in servlet_example2 and putting it in
the loadConfiguration() method of VelocityServlet itself, and using
getRealPath() to set all the path properties to be relative to
webapps/appname (or whatever getRealPath gets).  Then a good number of
users wouldn't have to write an override for loadConfiguration, and you'd
only have to document how to use loadConfiguration to get to somewhere
other than a path relative to webapps/appname.

As it is, I think everyone has to write a loadConfiguration method in
their servlet, because "." is a relative path that virtually no one wants
to use, and it is not intuitive to put any application files in this
directory.

Best wishes, and thank you for all you do for the user community.

Barbara Baughman
X2157