Class UserController<E extends User,​D extends UserDao<E>,​S extends UserService<E,​D>>

    • Constructor Detail

      • UserController

        public UserController()
        Default constructor, which calls the type-constructor
      • UserController

        protected UserController​(Class<E> entityClass)
        Constructor that sets the concrete entity class for the controller. Subclasses MUST call this constructor.
    • Method Detail

      • setService

        @Autowired
        @Qualifier("userService")
        public void setService​(S service)
        We have to use Qualifier to define the correct service here. Otherwise, spring can not decide which service has to be autowired here as there are multiple candidates.
        Specified by:
        setService in class AbstractWebController<E extends User,​D extends UserDao<E>,​S extends UserService<E,​D>>
        Parameters:
        service - the service to set
      • registerUser

        @RequestMapping(value="/register.action",
                        method=POST,
                        produces="application/json;charset=UTF-8")
        @ResponseBody
        public Map<String,​Object> registerUser​(javax.servlet.http.HttpServletRequest request,
                                                     @RequestParam
                                                     String email,
                                                     @RequestParam
                                                     String password)
        Parameters:
        email -
        password -
      • activateUser

        @RequestMapping(value="/activate.action",
                        method=GET,
                        produces="application/json;charset=UTF-8")
        @ResponseBody
        public Map<String,​Object> activateUser​(@RequestParam
                                                     String token)
        Parameters:
        token -
      • resetPassword

        @RequestMapping(value="/resetPassword.action",
                        method=POST,
                        produces="application/json;charset=UTF-8")
        @ResponseBody
        public Map<String,​Object> resetPassword​(javax.servlet.http.HttpServletRequest request,
                                                      @RequestParam("email")
                                                      String email)
        Parameters:
        email -
      • changePassword

        @RequestMapping(value="/changePassword.action",
                        method=POST,
                        produces="application/json;charset=UTF-8")
        @ResponseBody
        public Map<String,​Object> changePassword​(@RequestParam("password")
                                                       String password,
                                                       @RequestParam("token")
                                                       String token)
        Parameters:
        token -
      • getUserBySession

        @RequestMapping(value="/getUserBySession.action",
                        method=GET,
                        produces="application/json;charset=UTF-8")
        @ResponseBody
        public Map<String,​Object> getUserBySession()