tags:

views:

124

answers:

1

I have a module written in servlets and needs to be recently moved to velocity framework So in the process I am rewriting the web.xml to create velocity servlet object whcih calls our original servlet .

Now if this has to be moved to

<servlet>
<servlet-name>VeloServlet</servlet-name>
    <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>
</servlet>

How can we acheive this and what are all changes need to use the existing servlet as it is. My Existing servlet looks like

<servlet-name>DataBridgeServlet</servlet-name>
  <servlet-class>com.jda.pwm.databridge.framework.common.DataBridgeServlet</servlet-class>
<init-param>
  <param-name>jda.databridge.config.path</param-name>
  <param-value>d:/usr/databridge/conf</param-value>
</init-param>

This is loaded using the url http://localhost:8080/databridge/databridgeservlet

So in the newer case how velocity servlet calls this servlet

A: 

Have you looked at the VelocityViewServlet in the Velocity Tools project? This is a useful way of quickly getting Velocity pages on the web.

http://velocity.apache.org/tools/devel/view.servlet.html

You can subclass this for more customizability if desired. And if nothing else, you can look at the source and use this as inspiration to make your own servlet.

Will Glass