cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad <>
Subject @Path not mapping to required methods
Date Tue, 06 May 2008 13:35:26 GMT

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:

public class MailService {

	@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)
	@ConsumeMime({"application/xml", "application/json"})
	@ProduceMime({"application/xml", "application/json"})
	public MessageDocument readMessage(@PathParam("user")String user,
@PathParam("messageId")String messageId, @HeaderParam("token")String

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 "(.+?)" ?


View raw message