|
Home > Archive > WebSphere Application Server > May 2004 > WAS express 5.1 & velocity
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
WAS express 5.1 & velocity
|
|
|
| I am attempting to deploy an app built using velocity templates in
Websphere. When the page is displayed, it renders the actual code. Is
there some setting in websphere that needs to be changed to tell it to
interpret velocity templates?
Brian
| |
| Mark Phippard 2004-05-21, 5:39 pm |
| ba wrote:
> I am attempting to deploy an app built using velocity templates in
> Websphere. When the page is displayed, it renders the actual code. Is
> there some setting in websphere that needs to be changed to tell it to
> interpret velocity templates?
>
My understanding of velocity is that you would have to have the
Velocity servlet defined in your web.xml and mapped to a URL of *.vm or
something like that. That is what causes the Velocity page to be
processed by the Velocity runtime. If you didn't have that servlet
defined or mapped properly, then WebSphere would simply serve the raw
file.
Mark
| |
|
| I made an attempt to map the velocity servlet in the web.xml file and
I get an error in the browser which reads:
"Error 500: Failed to load target servlet [TurbineVelocityService] "
I have tried other classes from the velocity api as well with no luck.
Has anyone successfully used velocity templates within websphere
express? if so, can you show me your web.xml servlet mapping?
here is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!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 id="WebApp">
<display-name>glo</display-name>
<servlet id="Servlet_1">
<servlet-name>glostage</servlet-name>
<display-name>GLO Application</display-name>
<description>This is the initial servlet.</description>
<servlet-class>org.apache.turbine.Turbine</servlet-class>
<init-param id="InitParam_1">
<param-name>applicationRoot</param-name>
<param-value>webContext</param-value>
</init-param>
<init-param id="InitParam_2">
<param-name>properties</param-name>
<param-value>/WEB-INF/conf/TurbineResources.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet id="Servlet_2">
<servlet-name>TurbineVelocityService</servlet-name>
<display-name>velocity servlet</display-name>
<description>This is the initial velocity servlet.</description>
<servlet-class>org.apache.velocity.VelocityContext</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping id="ServletMapping_1">
<servlet-name>glostage</servlet-name>
<url-pattern>/glostage/servlet/glostage</url-pattern>
</servlet-mapping>
<servlet-mapping id="ServletMapping_2">
<servlet-name>TurbineVelocityService</servlet-name>
<url-pattern>*.vm</url-pattern>
</servlet-mapping>
<session-config id="SessionConfig_1">
<session-timeout>10</session-timeout>
</session-config>
<welcome-file-list id="WelcomeFileList_1">
<welcome-file>/templates/app/screens/Login.vm</welcome-file>
</welcome-file-list>
</web-app>
"Mark Phippard" <markp@softlanding.com> wrote in message news:<c8l2mj$3he4$1@news.boulder.ibm.com>...
> ba wrote:
>
>
> My understanding of velocity is that you would have to have the
> Velocity servlet defined in your web.xml and mapped to a URL of *.vm or
> something like that. That is what causes the Velocity page to be
> processed by the Velocity runtime. If you didn't have that servlet
> defined or mapped properly, then WebSphere would simply serve the raw
> file.
>
> Mark
|
|
|
|
|