[Jakarta-velocity Wiki] Update of "VelocityAndSpringStepByStep" by ShinobuKawaiYoshida

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Jakarta-velocity Wiki] Update of "VelocityAndSpringStepByStep" by ShinobuKawaiYoshida

Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-velocity Wiki" for change notification.

The following page has been changed by ShinobuKawaiYoshida:
http://wiki.apache.org/jakarta-velocity/VelocityAndSpringStepByStep

The comment on the change is:
Step 13 - Improve index.jsp (not very clean...)

------------------------------------------------------------------------------
 
  TODO: create content
 
+ == Step 13 - Improve index.jsp ==
+
+ We won't be needing an {{{include.vm}}}, but let's make the {{{springapp/war/WEB-INF/velocity}}} directory anyways.
+
+ ''Couldn't think of a neat way to convert this into velocity, so we'll cheat by installing !VelocityViewServlet.''
+
+ Add Velocity and VelocityTool jar to {{{springapp/war/WEB-INF/lib}}}
+
+ {{{web.xml}}} : Add !VelocityViewServlet settings
+ {{{
+   <servlet>
+     <servlet-name>velocity</servlet-name>
+     <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>
+     <load-on-startup>10</load-on-startup>
+   </servlet>
+
+   <servlet-mapping>
+     <servlet-name>velocity</servlet-name>
+     <url-pattern>*.vm</url-pattern>
+   </servlet-mapping>
+ }}}
+
+ And finally, {{{index.vm}}} : Use VTL instead of JSTL
+ {{{
+ ## Redirected because we can't set the welcome page to a virtual URL.
+ $response.sendRedirect("$request.getContextPath()/hello.htm")
+ }}}
+
+ TODO: Think of a better way to do this.
+
  = Part 3 - Adding Unit Tests and a Form to the Application =
 
  TODO: create content

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]