You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Mike Clovis <ms...@trifecta.com> on 2013/12/04 19:01:57 UTC

Spring/Struts usage

Hi ,
                I have a newbie question. When using a web framework like Spring you write controllers that are mapped to requests, add data to the response (Model Map) and return a uri to correct view. With velocity you could also write classes that would return the correct entities and add them to the velocity context. Then merge. How is this accomplished with Spring MVC? A small snippet would help. Do you call merge in the method w/o returning values through the map.


Thanks in advance,

Mike

Re: Spring/Struts usage

Posted by Will Glass-Husain <wg...@gmail.com>.
Spring MVC provides a VelocityView which automatically handles the template
merging.

There's an example here:
http://wiki.apache.org/velocity/VelocityAndSpringStepByStep

and here:
http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/view.html

WILL


On Wed, Dec 4, 2013 at 10:01 AM, Mike Clovis <ms...@trifecta.com> wrote:

> Hi ,
>                 I have a newbie question. When using a web framework like
> Spring you write controllers that are mapped to requests, add data to the
> response (Model Map) and return a uri to correct view. With velocity you
> could also write classes that would return the correct entities and add
> them to the velocity context. Then merge. How is this accomplished with
> Spring MVC? A small snippet would help. Do you call merge in the method w/o
> returning values through the map.
>
>
> Thanks in advance,
>
> Mike
>