bjui.ajax( ajaxform,jQuery (Semantic-UI) ajax POST form

I'm trying to POST a registration form using a Semantic-UI Api (based on ajax). The problem is that, I'm getting an 403 error code response. I have no idea how to handle this issue.

Code below:

@Controller:

@Controller

@RequestMapping("/user/")

public class UserController {

private final org.slf4j.Logger LOGGER = org.slf4j.LoggerFactory.getLogger(getClass());

// Registration

@RequestMapping(value = "register/", method = RequestMethod.POST)

@ResponseBody

public GenericResponse registerUserAccount(@Valid UserDTO user, HttpServletRequest request)

{

LOGGER.debug("Registration of account: ", user);

return new GenericResponse("success");

}

}

UserDTO domain class:

@PasswordMatches

public class UserDTO {

@NotNull

@NotEmpty

@Size(min = 1)

private String firstName;

@NotNull

@NotEmpty

@Size(min = 1)

private String lastName;

@ValidEmail

@NotNull

@NotEmpty

@Size(min = 1)

private String email;

@NotNull

@NotEmpty

@Size(min = 1)

private String password;

@NotNull

@NotEmpty

@Size(min = 1)

private String matchingPassword;

// ommited getters, setters etc.

}

.jsp (ommited unnecessary part):

$('.ui.form .submit.button')

.api({

url: '/PhotoAlbum/user/register/',

method : 'POST',

serializeForm: true,

beforeSend: function(settings) {

},

onSuccess: function(data) {

if(data.message == "success"){

window.location.href = "/PhotoAlbum/";

}

}

});

Form :

Apache Tomcat logs:

0:0:0:0:0:0:0:1 - - [09/Nov/2015:16:11:45 +0100] "POST /PhotoAlbum/user/register/ HTTP/1.1" 403 1192

0:0:0:0:0:0:0:1 - - [09/Nov/2015:16:11:45 +0100] "GET /PhotoAlbum/user/register/?firstName=John&lastName=McMann&email=jmac%40gmail.com&password=SomePass%401&matchingPassword=SomePass%401 HTTP/1.1" 200 6577

Thank you for help.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值