Hi,

I'm getting an issue where my @Path annotations aren't mapping to the
required URLs. Here's a rough outline of my test class:

@Path(value="/{domain}/{network}/{user}/mail")
public class MailService {

        @GET
        @ConsumeMime({"application/xml", "application/json"})
        @ProduceMime({"application/xml", "application/json"})
        public MailFolderDocument listMail(@PathParam("domain")String domain,
@PathParam("network")String network, @PathParam("user")String user,
@HeaderParam("token")String token){
            ....
        }

        @Path(value="/{messageId}", limited=true)
        @GET
        @ConsumeMime({"application/xml", "application/json"})
        @ProduceMime({"application/xml", "application/json"})
        public MessageDocument readMessage(@PathParam("user")String user,
@PathParam("messageId")String messageId, @HeaderParam("token")String
token){
            ....
        }
}

The problem I'm seeing is that when i invoke the URL
http://localhost:8081/cxf/rest/test/domain/network/brad/mail, it
invokes the readMessage method instead of listMail. Am I using the
correct format for my annotations here?

Anyway, just in case I have got it right (*pig flies by*) I stepped
through JAXRSUtils.findTargetMethod and I was left wondering if this
line is correct:

private static final String URITEMPLATE_VARIABLE_REGEX = "(.*?)";

I'm no regex expert but I did find this in the Java 1.5 API docs:

X*?     X, zero or more times
X+?     X, one or more times

Would that value make more sense as "(.+?)" ?

Thanks,
Brad.

Reply via email to