我正在使用 Liferay portal-6 和Spring-3
.
在我的 portlet 中,首先它转到@Rendermapping
不带参数并显示默认 jsp,当我单击一个按钮时,我正在传递actionurl
,但它不会转到相应的@Actionmapping
.
我的searchForm.jsp
样子是这样的:
<portlet:actionURL var="showSearchResultsUrl">
<portlet:param name="myaction" value="searchResults" />
</portlet:actionURL>
<form:form id="searchForm" name="searchForm" commandName="patientStoryForm" method="POST" action="${showSearchResultsUrl}" enctype="multipart/form-data" >
<input type="button" name="search_btn" value="Search"/></td>
</form:form>
我的控制器是这样的:
@Controller(value = "searchPatientStoryController")
@RequestMapping(value = "VIEW")
@SessionAttributes(types = PatientStoryForm.class)
public class SearchPatientStoryController {
@RenderMapping
public String showSearchForm(RenderResponse response, Model model) {
return "searchForm";
}
@RenderMapping(params = "myaction=searchResultsForm")
public String showSearchResultsForm(RenderResponse response, Model model) {
return "searchResultsForm";
}
@ActionMapping(params = "myaction=searchResults")
public void searchResults(
@ModelAttribute(value = "patientStoryForm") PatientStoryForm patientStoryForm,
BindingResult bindingResult, ActionResponse response, ActionRequest request,
SessionStatus sessionStatus, Model model) {
response.setRenderParameter("myaction", "searchResultsForm");
}
}
当我点击按钮时,searchForm.jsp
它应该去,@Actionmapping
但它没有去。
请帮我。
提前致谢。