Search in sources :

Example 6 with Redirect

use of com.tvd12.ezyhttp.server.core.view.Redirect in project ezyfox-examples by tvd12.

the class RegisterController method registerPost.

@DoPost("/register")
public Redirect registerPost(@RequestBody RegisterRequest request) {
    final User user = new User(request.getUsername(), request.getPassword(), request.getBirthOfDate(), LocalDate.now(), LocalDateTime.now());
    userService.addUser(user);
    return Redirect.to("/user/" + request.getUsername());
}
Also used : User(org.youngmonkeys.example.ezyhttp.thymeleaf.entity.User) DoPost(com.tvd12.ezyhttp.server.core.annotation.DoPost)

Aggregations

Redirect (com.tvd12.ezyhttp.server.core.view.Redirect)3 Cookie (javax.servlet.http.Cookie)3 Test (org.testng.annotations.Test)3 HashMap (java.util.HashMap)2 EzyApplication (com.tvd12.ezyfoxserver.EzyApplication)1 EzyAppRequestController (com.tvd12.ezyfoxserver.app.EzyAppRequestController)1 EzyAppContext (com.tvd12.ezyfoxserver.context.EzyAppContext)1 EzySession (com.tvd12.ezyfoxserver.entity.EzySession)1 EzyUser (com.tvd12.ezyfoxserver.entity.EzyUser)1 EzyUserRequestAppEvent (com.tvd12.ezyfoxserver.event.EzyUserRequestAppEvent)1 EzyRequestAppParams (com.tvd12.ezyfoxserver.request.EzyRequestAppParams)1 EzyUserManager (com.tvd12.ezyfoxserver.wrapper.EzyUserManager)1 MultiValueMap (com.tvd12.ezyhttp.core.data.MultiValueMap)1 ResponseEntity (com.tvd12.ezyhttp.core.response.ResponseEntity)1 DoPost (com.tvd12.ezyhttp.server.core.annotation.DoPost)1 RequestCookie (com.tvd12.ezyhttp.server.core.annotation.RequestCookie)1 RequestInterceptor (com.tvd12.ezyhttp.server.core.interceptor.RequestInterceptor)1 ComponentManager (com.tvd12.ezyhttp.server.core.manager.ComponentManager)1 RequestHandlerManager (com.tvd12.ezyhttp.server.core.manager.RequestHandlerManager)1 RequestURI (com.tvd12.ezyhttp.server.core.request.RequestURI)1