com.opensymphony.webwork.dispatcher.mapper.RestfulActionMapper.java中这段注释可能有帮助,用来表示REST方式的action
/** * A custom action mapper using the following format: *
*
*
http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2 ** You can have as many parameters you'd like to use. Alternatively the URL can be shortened to the following: *
*
http://HOST/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2 ** This is the same as: *
*
http://HOST/ACTION_NAME/ACTION_NAME + "Id"/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2 ** Suppose for example we would like to display some articles by id at using the following URL sheme: *
*
http://HOST/article/Id **
* Your action just needs a setArticleId() method, and requests such as /article/1, /article/2, etc will all map * to that URL pattern. *
* Note: The RestfulActionMapper is not supported if you use the (deprecated) ServletDispatcher! * * @author Cameron Braid * @author Jerome Bernard * @author Patrick Lightbody */
也就是说action也是资源
本文探讨了com.opensymphony.webwork.dispatcher.mapper.RestfulActionMapper.java中的RESTful行动映射机制,介绍了如何通过URL参数来指定不同的行动及参数,特别强调了自定义行动映射的灵活性,以及它如何简化了资源的定位。
1496

被折叠的 条评论
为什么被折叠?



