Spring portlet @ActionMapping用法

编程入门 行业动态 更新时间:2024-10-26 13:21:56
本文介绍了Spring portlet @ActionMapping用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

可以请任何人解释一下,如何正确映射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用法

本文发布于:2023-10-07 17:23:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1470014.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Spring   portlet   ActionMapping

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!