-14

I have a question about my Stack Overflow post: Resteasy - Multiple resource methods match request "POST /.../..."

2

1 Answer 1

7

The title is certainly not correct. Essentially what you are asking is a "how to" question to do routing based on the request payload, XML in this case. But the title vaguely refers to an error or warning you might get when you don't set that up properly, it does not describe the question at all. Remember that the title is the first thing people usually see and thus also the first moment where people are going to set expectations on what they are going to find when they click on it, it is very much in your own favour to make the title as appealing and on-topic as possible.

Routing has nothing to do with Jackson by the way, so it is not correct that Jackson is part of the tags. This is purely a JAX-RS/RestEasy question.

There is also a problem of a lack of shown research effort which opens up the door for the question receiving downvotes. You can't solve this with what a basic hello world tutorial would tell you, you need advanced features that the RestEasy (or JAX-RS) documentation will tell you about... or existing Stack Overflow question/answer pairs. Yet your question has only code which would be the product of a hello world tutorial - minimum effort. You may have done such research, but your question does not show it. People can only judge what is in the question. They can't judge what you are keeping to yourself.

Finally, I question usefulness. Your question asks if it can be done. But should you want to do this? Routing based on the path is easy, it documents well and it requires little processing power. Routing based on payload, especially XML, sounds needlessly costly and fragile to me since it'll likely involve having to do XPATH queries to work out which endpoint needs to be invoked. Even setting a HTTP header would be easier and scales better if you really must use a singular HTTP endpoint to do multiple things. But I don't really see why you wouldn't just do the REST thing and define unique endpoints for each unique operation. /book and /book/advanced, for example. The HTTP method should determine what needs to be done to a book, but you're still free to just define a /book/add and a /book/advanced/add if you really want to.

Not the answer you're looking for? Browse other questions tagged .