Hello All

Im evaluating Restlet, and came across some behaviour I hope i could get help
with. It basically centers around the following code:

} else if (request.getMethod().equals(Method.POST)) {
                
                Form form = request.getEntityAsForm();
                        
                if (form != null) {
                        
                        try {
                                
                                User user = new User();
                        UserRestlet.populateUser(form, user);
                                getUserDAO().updateUser( user );

                                
response.setRedirectRef(user.getHref().toExternalForm());
                                response.setEntity(user.toXML(), 
MediaType.APPLICATION_XML);
                                response.setStatus(Status.SUCCESS_OK);
                                
                        } catch (Exception e) {
                                        e.printStackTrace();
                        response.setStatus(Status.SERVER_ERROR_INTERNAL);
                                }
                
                        
                } else {
                response.setStatus(Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, 
"User
not provided");
                }
                
            }


For some reason, my Form object, when populated with getEntityAsForm() from the
Request object, always comes back with none of my form information... when using
Eclipse to introspect the "delegate" member variable, it comes back as an empty
array... I dont yet have any other Guards or Restlets chained before this, it is
simply trying to take a form-encoded post and grab that data out to build a user
object.

This seems like the other samples I've seen, am I doing something wrong?

thanks for the help.




Reply via email to