设为首页 加入收藏

TOP

Spring Security 学习之HTTP表单验证(二)
2014-11-24 01:09:09 来源: 作者: 【 】 浏览:11
Tags:Spring Security 习之 HTTP 表单 验证
ivate static final Logger logger = LoggerFactory.getLogger(HomeController.class);

/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
logger.info("Welcome home! The client locale is {}.", locale);

Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);

String formattedDate = dateFormat.format(date);

model.addAttribute("serverTime", formattedDate );

return "home";
}

//produces="text/plain" 必须有,否则会有乱码
@RequestMapping(value = "/hello", method = RequestMethod.GET, produces="text/plain")
@ResponseBody
public String hello(){
logger.info("request coming!");
return "Hello Stevex, you are so hard!";
}

}


6. 运行应用进行测试


Spring Security 学习之HTTP表单验证



大功告成!


Spring Web MVC Security 下载地址


具体下载目录在 /2014年资料/2月/28日/Spring Security 学习之HTTP表单验证


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇[SHELL] Linux流量监控脚本 下一篇Spring Security 学习之HTTP基本..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: