velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James You <j...@hywy.com>
Subject Re: Problem in TOMCAT... URGENT
Date Tue, 12 Mar 2002 16:17:56 GMT
Hi, Rangaraj:
You may try to change the value of the properties for
"file.resource.loader.path"
to the differnt format in the velocity.properties file, such as:
     ---  file.resource.loader.path=./WEB-INF/templates
     --- 
file.resource.loader.path=c:\\tomcat\\webapp\\myApplication\\WEB-INF\\templates
You may need to test your currrent working directory using the following
code, then you can
determine how you can set the value for the properties of
"file.resource.loader.path".
     File file = new File(".");
     System.out.println(" The current working directory is -> " +
file.getAbsolutePath());

Or you may put your template file in the diffenet location to test your
application.

I hope the above suggestion can help you to find the problem.


James You
Hywy Software Inc.
Canada





Rangaraj.T@lntinfotech.com wrote:
> 
> Hi all,
> 
> I have the servlet application using TOMCAT-IIS AND VELOCITY Template. My
> OS is WIN2K SERVER.
> 
> I have the login.html page, in that on submitting the request from the
> Login page, the servlet "LoginVerify" for verifying the Login information
> is called,
> 
> In that servlet i have to verify the login information, if it is successful
> i have to display the next screen using the template file. Actual problem
> is when I call
> 
> "getTemplate("FunctionSelection.vm " ) " in my servlet that loads the
> template file, i am getting the error message as
> 
> "org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'FunctionSelection.vm' "
> 
> Note : Here "FunctionSelection.vm" is my template file ( It is present
> under /WEB-INF/templates folder as specified in velocity.properties file)
> 
> Please find the web.xml, velocity.properties file below.
> 
> web.xml file
> ************
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
> <web-app>
> <servlet>
>     <servlet-name>LoginVerify</servlet-name>
>     <servlet-class>cife.servlets.LoginVerify</servlet-class>
>     <init-param>
>          <param-name>properties</param-name>
>          <param-value>/WEB-INF/velocity.properties</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>     </servlet>
> </web-app>
> 
> velocity.properties file
> ********************
> 
> #
> # we are taking advantage of the fact that the file
> # resource loader is the default loader
> #
> file.resource.loader.path = WEB-INF/templates
> runtime.log = WEB-INF/velocity.log
> 
> ---------------------
> 
> Could anyone help me on how to do the configuration for web.xml and
> velocity.properties file?
> 
> Thanks in advance.
> 
> With Regards,
> Rangaraj
> 
> --
> To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>

--
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