How to map long REST URLs in struts2 - using restuts2 plugin

I have learned to use the restuts2 plugin in the last few days. But no where have I found how to map long rest URLs.

For example, If I want to map a URL as shown below:

/profiles/user-test/orders/64/item/4 

Where

 username is user-test order id is 64 item id is 4 

How can I match something like this with struts2 action?

All that I found on the Internet is only one level that is edited / displayed, etc. But if I want to display something at a multilevel level - then how to act? Please guide.

+4
source share
1 answer

You can do this with Advanced Wildcard Mappings without the REST plugin:

/profiles/user-test/orders/64/item/4

username - user test

order ID - 64

Id element is 4

The action configuration required for this example will be as follows:

 <action name="/profiles/{username}/orders/{order}/item/{item}" class="fooBarAction"> <result>fooBar.jsp</result> </action> 
+5
source

All Articles