Java 在Liferay 6.2中使用ActionMapping/RequestMapping时,请求中的表单数据为空

Java 在Liferay 6.2中使用ActionMapping/RequestMapping时,请求中的表单数据为空,java,liferay,liferay-6,spring-portlet-mvc,Java,Liferay,Liferay 6,Spring Portlet Mvc,在Liferay 6.2中,当我试图获取以表单形式提交的数据时,它返回空值,就好像表单数据被丢弃一样 JSP: 为什么会发生这种情况?您应该在名称值中添加名称空间前缀,如下所示: <input type="text" name="<portlet:namespace />inputTextName" /> 或者,您可以在liferayportlet.xml中将requires namespaced parameters设置为false 这是自Liferay 6.2以

在Liferay 6.2中,当我试图获取以表单形式提交的数据时,它返回空值,就好像表单数据被丢弃一样

JSP:


为什么会发生这种情况?

您应该在
名称
值中添加名称空间前缀,如下所示:

<input type="text" name="<portlet:namespace />inputTextName" />

或者,您可以在
liferayportlet.xml
中将
requires namespaced parameters设置为false

这是自Liferay 6.2以来的一个变化:

他们决定从6.2开始对表单进行更严格的修改。据我所知,在Liferay论坛上,默认设置为false仍然存在争议,因此它可能会自动设置,但现在您必须手动处理名称空间

@ActionMapping(params = { "action=doSomething" }, method = RequestMethod.POST)
public void doSomething(@RequestParam(value = "comboSelect") String selection){
    System.out.print(selection);
}
<input type="text" name="<portlet:namespace />inputTextName" />