可以请任何人解释一下,如何正确映射POST请求?从API文档中不清楚。
could please anybody explain, how POST request should be mapped properly ? it is not clear from API documentation.
值应该赋值为action参数javax.portlet.action的值
value should be assigned with the value of the action parameter javax.portlet.action
@ActionMapping(value = "addDocOrder") public void addDocOrder(@ModelAttribute("order").......接下来我们有params(JAVADOC:映射请求的参数,缩小主映射。)
AND next we have "params" (JAVADOC: The parameters of the mapped request, narrowing the primary mapping.)
@ActionMapping(params = "action=addDocOrder") public void addDocOrder(@ModelAttribute("order").......
注释的value()参数的JAVADOC:名称动作,根据 Portlet 2.0javax.portlet.action参数。如果未指定,方法将用作默认的处理程序:即对于动作请求,其中没有找到特定的动作映射。请注意,所有这些带注释的动作方法仅适用于 @Reques tMapping含有的处理程序类的约束。
JAVADOC for value() parameter of annotation: The name of the action, according to the Portlet 2.0 "javax.portlet.action" parameter. If not specified, the method will be used as default handler: i.e. for action requests where no specific action mapping was found. Note that all such annotated action methods only apply within the @RequestMapping constraints of the containing handler class.
我绝对不知道什么是值注释参数存在的要点。在那里它没有任何意义......它意味着是主要的映射,它是次要的,但{params =action = addOrder}使价值变得多余。
I absolutely don't get what is the point of the existence of the "value" annotation parameter. it has afaik no sense in being there ...it is meant to be the primary mapping, params the secondary one, but {params = "action=addOrder"} makes "value" redundant.
请看一下这个问题也是相关的 https: //stackoverflow/questions/4782971/handling-ajax-requests-with-spring-portlet
PLEASE: Take a look at this issue which is also relevant stackoverflow/questions/4782971/handling-ajax-requests-with-spring-portlet
推荐答案我同意你的评估。我在阅读规范时可以看到的唯一真正优势是添加了标签中的一些特殊处理。显然这两个是等价的:
I agree with your assessment as well. The only real advantage I can see when reading the spec is that some special handling in the tag was added. Apparently these two are equivalent:
<portlet:actionURL> <portlet:param name="javax.portlet.action" value="addDocOrder"/> </portlet:actionURL> <portlet:actionURL name="addDocOrder" />这是来自规范中的PLT.26.2 actionURL标签。
That is from "PLT.26.2 actionURL Tag" in the spec.
更多推荐
Spring portlet @ActionMapping用法
发布评论