Spring GateIn 3.2忽略actionURL参数
我正在使用Spring GateIn 3.2忽略actionURL参数,spring,jsp,spring-mvc,tomcat7,gatein,Spring,Jsp,Spring Mvc,Tomcat7,Gatein,我正在使用gatein3.2.0.FINAL和tomcat7(GateIn-3.2.0.FINAL-tomcat7.zip)。似乎忽略了actionURL中的参数 我的控制器如下所示: @ActionMapping("search") public void search(ActionRequest request) { LOG.info("doing search"); } @ActionMapping("save") public void save(ActionRequest r
gatein3.2.0.FINAL
和tomcat7
(GateIn-3.2.0.FINAL-tomcat7.zip
)。似乎忽略了actionURL
中的参数
我的控制器如下所示:
@ActionMapping("search")
public void search(ActionRequest request) {
LOG.info("doing search");
}
@ActionMapping("save")
public void save(ActionRequest request) {
LOG.info("doing save");
}
<portlet:actionURL var="saveURL">
<portlet:param name="javax.portlet.action" value="save"/>
</portlet:actionURL>
<form:form id="${ns}-save" action="${saveURL}" modelAttribute="createModel">
<!-- omitted some html -->
<input type="submit" value="submit"/>
</form:form>
/portal/classic/home/Permissions?navigationalstate=<gibberish>&portal:componentId=<an UUID>&interactionstate=<gibberish>&portal:type=action&portal:isSecure=false
我的JSP如下所示:
@ActionMapping("search")
public void search(ActionRequest request) {
LOG.info("doing search");
}
@ActionMapping("save")
public void save(ActionRequest request) {
LOG.info("doing save");
}
<portlet:actionURL var="saveURL">
<portlet:param name="javax.portlet.action" value="save"/>
</portlet:actionURL>
<form:form id="${ns}-save" action="${saveURL}" modelAttribute="createModel">
<!-- omitted some html -->
<input type="submit" value="submit"/>
</form:form>
/portal/classic/home/Permissions?navigationalstate=<gibberish>&portal:componentId=<an UUID>&interactionstate=<gibberish>&portal:type=action&portal:isSecure=false
如果我用firebug手动编辑URL,并将&javax.portlet.action=save
添加到URL中,它就像一个符咒,在控制器中找到save()
方法
现在,如果我在jbossportal2.7.2
中部署完全相同的war
,那么&javax.portlet.action=save
将包含在URL中。同样的情况也适用于3.1.0版本中的GateIn.FINAL和Tomcat 6
PS
我还尝试了另一个参数键:
@ActionMapping({params = "myparam=save"})
public void save(ActionRequest request) {
LOG.info("doing save");
}
……和:
<portlet:actionURL var="saveURL">
<portlet:param name="myparam" value="save"/>
</portlet:actionURL>
尝试在actionURL上设置
escapeXML=“false”
试试这个
ActionMapping({params = "action=save"})
public void save(ActionRequest request) {
LOG.info("doing save");
}
及
action是默认的参数名,您必须进行其他更改才能使用自己的名称。这与ActionMapping(“保存”)和portlet:param name=“javax.portlet.action”是一样的。已经试过了。请看我问题中的后记。嘿,奥斯卡,你得到这个问题的解决方案了吗?实际上,我也面临着同样的问题