You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Frans Thamura <fr...@meruvian.org> on 2008/03/07 17:33:31 UTC
Velocity Classloader Implementation Problem @ S2
hi all
i put all my velocity tempate in the .jar file
and the folder structure is like this
/view/frontpage/login/login.vm
and i got this error
Mar 7, 2008 11:28:55 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource '/WEB-INF/view/frontpage/login/login.vm'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource
(ResourceManagerImpl.java:458)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(
ResourceManagerImpl.java:341)
but in the console i got this
[INFO] VelocityManager - Initializing velocity using
velocity.propertiesfrom classloader
anyone can help?
i just want to put the velocity template in the .jar,
F
Re: Velocity Classloader Implementation Problem @ S2
Posted by Frans Thamura <fr...@meruvian.org>.
i can run it ...
i put the template in /src/java, one level with the java code
but when i try to make a .jar, the velocity still cannot recognize the
template
this is my velocity.properties
resource.loader=class
class.resource.loader.description = Velocity Classpath Resource Loader
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache = false
class.resource.loader.modificationCheckInterval=2
class.resource.loader.path=.,/
i think this is not s2 question anymore :) will go to velcity mailing list
F
Re: Velocity Classloader Implementation Problem @ S2
Posted by Frans Thamura <fr...@meruvian.org>.
On Sat, Mar 8, 2008 at 12:01 AM, Dave Newton <ne...@yahoo.com> wrote:
> --- Frans Thamura <fr...@meruvian.org> wrote:
> > /view/frontpage/login/login.vm
> > [...]
> > resource '/WEB-INF/view/frontpage/login/login.vm'
>
> Looks to me like Velocity is expecting them to be under WEB-INF, no?
>
i got it :) hehe, i put /WEB-INF in my .xml
anyway
what is the path for template
my tempalate folder structure is /homevm mean the file in the root
i try to put the template just "home.vm", got this error
got this error
Unable to find resource '//home.vm'
my action setting like this
<action name="home" class="org.blueoxygen.papaje.actions.FrontPage">
<result name="success" type="velocity">home.vm</result>
<result name="input" type="velocity">home.vm</result>
</action>
or
<action name="home" class="org.blueoxygen.papaje.actions.FrontPage">
<result name="success" type="velocity">/home.vm</result>
<result name="input" type="velocity">/home.vm</result>
</action>
i think i have difficulty to map the template inside jar with the result tag
can help?
Re: Velocity Classloader Implementation Problem @ S2
Posted by Dave Newton <ne...@yahoo.com>.
--- Frans Thamura <fr...@meruvian.org> wrote:
> /view/frontpage/login/login.vm
> [...]
> resource '/WEB-INF/view/frontpage/login/login.vm'
Looks to me like Velocity is expecting them to be under WEB-INF, no?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org