?? registercontroller.java.svn-base
字號:
package com.google.code.rsser.web.controller;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.propertyeditors.StringTrimmerEditor;import org.springframework.web.bind.ServletRequestDataBinder;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.servlet.mvc.SimpleFormController;import com.google.code.rsser.model.User;import com.google.code.rsser.service.UserService;@RequestMapping(value = "/register.html")public class RegisterController extends SimpleFormController { @Autowired protected UserService userService; @Override protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception { super.initBinder(request, binder); binder.setAllowedFields(new String[] { "login", "password", "confirmPassword", "email" }); binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); } @Override protected void doSubmitAction(Object command) throws Exception { userService.save((User) command); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -