Custom function with additional argument using Struts2 REST plugin

前端 未结 1 1783
野性不改
野性不改 2021-01-15 21:59

Is there anyway to have additional arguments in the url of a struts2 rest plugin controller?

For example, I have:

         


        
相关标签:
1条回答
  • 2021-01-15 22:48

    It would be not REST style to have such URLs. Instead, you can use two URLs to access different resources.

     [domain]/person/{id}
    
     [domain]/comment/{commentId}
    

    On the other hand if you mix convention and rest style mapping you can use namedVariable or regex pattern matcher to achieve what you would like to have.

    0 讨论(0)
提交回复
热议问题