velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Blair Martin" <bla...@mindspring.com>
Subject The "proper" way to configure/deploy Velocity servlets on an app server?
Date Mon, 12 Nov 2001 04:32:30 GMT
I'm deploying an app on an app server (iPortal App. Server). The web app
portion (servlets using Velocity) is packaged in a .war file which in turn
is packaged in a .ear file along with other components (e.g. .jar file
containg EJBs). This is then deployed on the server. My question concerns
the "proper" way to configure Velocity vis-a-vis the templates, properties
file and output log. I've read the docs and archives so I know how to get
things working but I wonder if I'm doing it the best way.

Initially, I tried using the file resource loader but this doesn't seem to
be a good idea because it's difficult to locate the templates. The app
server deals with .ear/.war.jar files so I don't even know what the real
path to the template files would be ( getServletContext().getRealPath()
returns null ). So I next tried class path resource loader after packaging
the template files in a .jar in the WEB-INF/lib directory. This worked. Is
this the best way to do it? Is there something I'm missing with using file
resource loader?

The uncertainty of runtime paths also has me confused about where to put a
properties file (and where velocity.log is written). I know you can specify
a path as an init-parameter in web.xml but it's unclear what the path is
relative to. In other words, at runtime the servlet doesn't seem to know
anything about the web app root (ie. the location of WEB-INF). In my case,
if default locations are used (no paths specified) than velocity.log, for
example, is written to the iPortal bin directory (\iportal\ipas3\bin). I
guess what I'm asking is how do I get the full, runtime path to the web app
root. As I write this I realize I'm not being totally Velocity-centric with
my question but perhaps someone who addresses the earlier question might be
able to help.

Thanks!

Blair Martin



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


Mime
View raw message