Clone this wiki locally
It’s common to have resources that are logically children of other resources. In
rewrite we call them nested resources, e.g.
<routes> <resource name=":user"> <resource name=":album"> <member action=":picture"/> </resource> </resources> </routes>
|PUT||/dscape||Update user dscape||/resource/user.xqy?action=put&user=dscape|
|GET||/dscape/thailand||See Thailand Album||/resource/album.xqy?action=get&user=dscape&album=thailand|
|GET||/dscape/thailand/burger.jpg||See the burger picture taken in thailand by user dscape||/resource/album.xqy?action=picture&user=dscape&album=thailand&picture=burger.jpg|
As you can see nested routes can also be dynamic, allowing behaviors like multiple users having multiple pages using a syntax like /dscape/aboutme instead of /user/dscape/page/aboutme.
Determining the action is an important step in rewrite because it tells the application what method to invoke in runtime when you do a specific request. Because it is possible to have actions with
rewrite we decided the following rules regarding actions:
*from the beginning of the action. No-one wants to call the
*databasexquery script so these should be removed.
- For actions that have
-thus making it valid function and file names.