Just wonder if it is possible to achieve this.
I write a sling service called /wcmapi/myservice. I want to service to handle the URLs.
The service will take the last value (myplan or mycontact or myhome) in the url as input to generate different output. since the logic is very simple and output as well, instead creating an interface and implement three services, can I combine three services into one service and use the last value in the URL mimic as selector?
Let me know if it is feasible.
Define as this
methods = "GET", metatype=true)
Use the last word as input variable. In this case, it is either home, or contactus or yourplan.
I looked at that article,
I don't think they are talking about not using selector but suggestion is when things gets complicated in one service, you can have multiple service to keep it simple.
But selector is the way to go.
Thank you for the information. It is very helpful.
However, I really like the calling URL to be /bin/myservice/home instead /bin/myservice.home. Using sling selector, the URL becomes /bin/myservice.home.