Package com.dream.dto.user.registration

Examples of com.dream.dto.user.registration.RegistrationDTO


        return RegistrationDTO.class.equals(clazz);
    }

    @Override
    public void validate(Object target, Errors errors) {
        RegistrationDTO registrationDTO = (RegistrationDTO) target;

        String username = registrationDTO.getUsername();
        if (ValidateUtil.isEmptyText(username)) {
            errors.rejectValue("username", null, "Username must not be empty!");
        }

        String password = registrationDTO.getPassword();
        if (ValidateUtil.isEmptyText(password)) {
            errors.rejectValue("password", null, "Password must not be empty!");
        }

        String nickname = registrationDTO.getNickname();
        if (ValidateUtil.isEmptyText(nickname)) {
            errors.rejectValue("nickname", null, "Nickname must not be empty!");
        }

        String email = registrationDTO.getEmail();
        if (ValidateUtil.isEmptyText(email)) {
            errors.rejectValue("email", null, "Email must not be empty!");
        } else {
            if (ValidateUtil.isEmail(email)) {
                boolean exist = userService.emailExist(email);
View Full Code Here


        setFormView("user/registrationForm");
    }

    @Override
    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        RegistrationDTO registrationDTO = (RegistrationDTO) command;
        userService.createUser(registrationDTO);
        return new ModelAndView("redirect:/login");
    }
View Full Code Here

TOP

Related Classes of com.dream.dto.user.registration.RegistrationDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.