I'm making an API for my web application, which runs on a tomcat server, the plan is to make a CRUD REST API
like Prestashop but i don't know how to add the ids of a table to the url path.
So when you go to customers(http://yourUrl.com/api/customers
) you will get the reply:
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<customers>
<customer id="1" xlink:href="http://yourUrl.com/api/customers/1"/>
<customer id="2" xlink:href="http://yourUrl.com/api/customers/2"/>
<customer id="3" xlink:href="http://yourUrl.com/api/customers/3"/>
<customer id="4" xlink:href="http://yourUrl.com/api/customers/4"/>
<customer id="5" xlink:href="http://yourUrl.com/api/customers/5"/>
<customer id="6" xlink:href="http://yourUrl.com/api/customers/6"/>
<customer id="7" xlink:href="http://yourUrl.com/api/customers/7"/>
<customer id="8" xlink:href="http://yourUrl.com/api/customers/8"/>
<customer id="9" xlink:href="http://yourUrl.com/api/customers/9"/>
<customer id="10" xlink:href="http://yourUrl.com/api/customers/10"/>
<customer id="11" xlink:href="http://yourUrl.com/api/customers/11"/>
</customers>
</prestashop>
And then you can go to http://yourUrl.com/api/customers/1
then my plan is to add a servlet with several mappings, I've found out how to ad servlets but not mappings at runtime.
How can i archive this?