Hi Rick,
The way we use request and response in JSP's is similar in Velocity as well. Just the syntax differs
for eg:
1#set ($myRequestVariable = $request.getAttribute("sharan"))
2
3you can get session - $request.getSession()
So coming to your example,
You can always set Model attributes map and get the object,
1@RenderMapping
2public ModelAndView show(RenderResponse response) {
3 ModelMap map = new ModelMap();
4 map.put("response", response);
5 return new ModelAndView("home", map);
6}
here you have added response object to the map - Request and Response are implicit objects for any server side templating mechanisms. You need not pass it. You have them available all the time in your velocity context
Think that you will be adding some other object say <b>userDetails</b> to the Model Map.
Now it is easier to access userDetails in Velocity like below
#set($first_name = $userDetails.getFirstName())
#set($last_name = $userDetails.getLastName())
Spring will make the things happen in the background.
HTH,
Sharan
Please sign in to flag this as inappropriate.