-
1. Re: 403 Rest service seam 2.1.2 GA
mhiggins.matt.smartdestinations.com Jul 9, 2009 6:23 AM (in response to mhiggins.matt.smartdestinations.com)Looks like you can't use @RequestParameter. I updated my @Path annotations and used @PathParam to get the username and password. I suppose this is more rest like anyway but this was my first experiment.
my class now looks like this for anyone who has had this problem
@Path("/user/{username}/{password}")
@Name("userResource")
public class UserResource {
@Logger
Log log;
@In(create=true)
UserService userService;
@GET
@Path("/favorite")
@Produces("text/xml")
public Set<Venue> getFavorites(@PathParam("username") String username , @PathParam("password") String password){
User user = userService.findUserByUnameOrEmail(username, username);
if(userService.validatePassword(user, password)){
return user.getProfile().getFavorites();
}
return new HashSet<Venue>();
}
}