Question

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

Was it helpful?

Solution

You should take a look at: jpublish.org (I am the maintainer, therefore biased :) and replace your Servlet with a simple Action; scripting (BSH, JS) or Java, as you feel fit. My 0.2CAD

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top