首页>代码>Spring MVC+mybatis整合小程序,适合新手学习>/Register2/src/com/control/HelloWorldController.java
package com.control;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.model.User;
import com.service.UserManager;

@Controller
public class HelloWorldController {
	@Resource(name = "UserManager")
	private UserManager um;

	@RequestMapping(value = "helloworld")
	public ModelAndView register(User user) throws Exception {
		System.out.println(user.getUsername());
		if (!um.exists(user)) {
			um.add(user);
			return new ModelAndView("registerSuccess","registerSuccess", user);
		} else {
			return new ModelAndView("registerFail","registerFail",user);
		}
	}
}
最近下载更多
李亮  LV19 2023年3月7日
KiwiFruit2020  LV4 2020年2月1日
feng正经  LV3 2019年11月24日
0312wangchen  LV26 2019年11月23日
zhangxuelin  LV2 2019年7月13日
cxkikun  LV8 2019年5月6日
1231578  LV9 2018年12月12日
bulklj  LV10 2018年12月11日
新的心跳hhl  LV10 2018年10月23日
787913754  LV1 2018年10月19日
最近浏览更多
微信网友_6510254668124160  LV1 2023年6月8日
1379585889  LV11 2023年6月7日
李亮  LV19 2023年3月6日
YUProject  LV8 2022年12月21日
vitos5n  LV9 2022年9月26日
janefilion  LV3 2022年8月24日
谢谢谢谢谢谢你  LV6 2022年7月19日
夜上清元  LV8 2022年6月17日
withcharming  LV1 2022年5月27日
XHKxhk  LV2 2022年5月15日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友