I would like to build a dynamic web project like that:
Method: GET | POST | DELETE API URL: http://example.com/api/
Example:
- I need to get User by executing URL: http://example.com/api/users/user_id/
- To get List of user's albums by executing URL: http://example.com/api/users/user_id/list/
- ...
So can you help me How can I do it by using STRUTS 2. Please explain something about it if you can.
You can do this by using namespace attribute of the Package tag in your struts configuration file struts.xml.
Below is the example for doing this.