「/page1.jsp」、「/page2.jsp」、「file.java」の 2 つの JSP ページがあります。「/page1」からフォームを送信した後、アクション メソッドに移動して、データベースからいくつかのレコードを取得し、私が持っているレコードを含む「/ page2」とリストします。すべてが完了しましたが、何らかの理由で「/page2」ページに移動できず、別の場所 (別の .jsp ページ) に移動します。
liferay を使用し、MVCPortlet クラスを拡張しています
前もって感謝します!!!。
public void AddCustomer(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException {
...
pCustomer.setCustomerId(customerId);
// set UI fields
pCustomer.setName(cusName);
pCustomer.setAddress(address);
pCustomer.setComments(comments);
try {
PCustomerLocalServiceUtil.addPCustomer(pCustomer);
} catch (com.liferay.portal.kernel.exception.SystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
...
}
addCustomer.jsp:
<portlet:actionURL var="addCustomersAct" name="AddCustomer">
<portlet:param name="jspPage" value="/allCustomers.jsp"/>
</portlet:actionURL>
<form method="post" action="<%= addCustomersAct %>">
...
</form>
allCustomers.jsp
<%for (PCustomer allCustomer : customers) { %>
<tr>
...//List of all customers
</tr>
<% } %>
addCustomers.jsp の上に、さらにいくつかのポートレット パラメータがあります。これは、サイドメニューがあり、レンダリング リクエストに必要であるためです。