I'm writing ReST services using JAXB/Jersey. I would like to do different server-side processing and return a different response based on whether or not the URL has query parameters. Example:
http://domain.com/Person
would map to a page documenting the available "Person" services, while
http://domain.com/Person?search="someName"
would return the results of a lookup on people.
I currently have a convention that users can get usage/documentation for each category of services by requesting the base URL (i.e., http://domain.com/Person, http://domain.com/Facility). Also, documentation is returned in XML, JSON, HTML, or plain text, depending on the Content-Type header.
Question 1: Is this a good design for a ReST service?
Question 2: How can I map URLs to different responses based on whether the URL has query parameters?