In my previous post I showed the steps you have to take to create your first ADF REST resource. You can find it here: First steps with REST services on ADF Business Components. I will continue my exploration in the world of ADF REST.
We are now going to configure the URL and test the new service.
After you run your application, you will see the endpoint in your JDeveloper log:
The first thing you will probably notice is the structure of the URL and there is little chance you will like it. Let’s change that first. There are two parts of the URL that can be configured, the Context Root (EMP-RESTWebService-context-root) and the URL pattern (/rest/).
The Context Root can be set in the Project Properties of the RESTWebService project. Open the properties and go to the Java EE Application tab. It shows an input field for the Java EE Web Context Root and you will recognize the name from your service URL. Choose a relevant and general name. It will be used for all your services.
The URL pattern is configurable in your web.xml file. This file is part of the RESTWebService project. Open it and go to the Servlets tab. Select the only Servlet in the list and open the sub tab Servlet Mappings. Here you can choose your own URL pattern. If you don’t want any pattern, you can enter: ‘/*’. Read the complete article here.
For regular information become a member in the WebLogic Partner Community please visit: http://www.oracle.com/partners/goto/wls-emea ( OPN account required). If you need support with your account please contact the Oracle Partner Business Center.