16171819202122
public View getFood(HttpServletRequest request) { Food food = new Food(); food.setName("orange"); food.setPrice(3.5); request.setAttribute("fruit", food); return new JspView("/food.jsp"); }
21222324252627
return new JspView("/food.jsp"); } @RequestMapping(value = "/food/view1") public View getFoodView(HttpServletRequest request) { return new JspView("/foodView1.jsp"); }
private static Log log = LogFactory.getInstance().getLog("firefly-system"); @RequestMapping(value = "/hello") public View index(HttpServletRequest request) { request.setAttribute("hello", "你好 firefly!"); return new JspView("/index.jsp"); }
49505152535455
} @RequestMapping(value = "/book/value") public View bookValue(HttpServletRequest request, @HttpParam Book book) { request.setAttribute("book", book); return new JspView("/book.jsp"); }
54555657585960
return new JspView("/book.jsp"); } @RequestMapping(value = "/book/create", method = HttpMethod.POST) public View createBook(@HttpParam("book") Book book) { return new JspView("/book.jsp"); }