I have a bunch of web services with a very simple structure:
@Path("/someprefix"+"/classA")
public class ClassA {
@Path(/method1)
public ClassB method1(ClassC c) {
...
}
}
Notice that there are no path params. As you can see I always use the name of the class plus some prefix and the name of the method. For example:
/someprefix/classA/method1 -> classA.method1
/someprefix/classA/method2 -> classA.method2
/someprefix/classB/method1 -> classB.method1
/someprefix/classB/method2 -> classB.method2
I want to be able to produce the same structure without using the Path annotation, since I don't want to duplicate the name of the class/method every time. It is error prone.
I searched around and tried multiple things, but nothing seems to work. I am using Apache CXF.