I am studying JavaEE and I have made my project for the learning experience.
I want to understand how best to write code from the point of view of architecture and use of relevant technologies. I am particularly interested to hear about the implementation of the REST-layer.
The purpose of this is the backend to the Android application. Uses postgres, wildfly(EJB) and REST.
This is one from many methods in REST layer.
@POST
@Path("/reg")
@Produces(MediaType.APPLICATION_JSON)
public Response create(@QueryParam("email") String email, @QueryParam("pass") String pass) {
log.info("create user");
log.debug("create user: email=" + email + " pass=" + pass);
Response response;
try {
response = Response.ok().entity(userM.reg(email, pass)).build();
log.info("reg ok");
} catch (Exception e) {
AppException err = new AppException(e);
response = Response.serverError().status(err.getCode()).entity(err).build();
log.info("reg fail");
}
return response;
}