@QueryParam("username")
public String username;
@QueryParam("remember")
public boolean remember;
@QueryParam("password")
@POST
@Path("login")
@Consumes("application/x-www-form-urlencoded")
@Produces("text/plain")
public Boolean login(@NotNull @FormParam("username") final String
username, @NotNull @FormParam("password") final String password) {
try {
String _password = EncryptUtil.encodeMD5(password);
subject.login(new UsernamePasswordToken(username, _password, remember));
return subject.getPrincipal() != null;
} catch (UnknownAccountException e) {
return false;
}
}