Modify URL for Jax-Rs Application
There are multiple ways to do this, in this blog i will show 2 main approach to do the same
Method1 : To Modify Application Class
- Create a sample Jax-Rs Application
Create a basic Jax-Rs Application
- Modify Application path in RestApplication
- Compile and run
Method 2 : Although above approach does the job but it has a drawback wherein when we create a new service we need to register the same in our Application Class. As the number of services grow this process may become lengthy and tedious , hence we edit our Application class to include all services inside our specified package and Modify web.xml file to customize the url.
- Modify RestApplication to include packages
Comments
Post a Comment