package com.wzq.springmvc.handlers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class HelloWorld { /*1.@RequestMapping注解来影射请求的URL * 2.返回值会通过视图解析器为实现物理视图,对于InternalResourceViewResolver视图解析器,会做如下的解析: * 通过prifix+suffix+后缀得到实际的视图 */ @RequestMapping("/helloworld") public String hello() { System.out.println("hello"); return "success"; } } 在WebContent下新建目录/views/并新建jsp文件success.jsp
|
|
来自: 魏祖清 > 《helloworld》