我可以从 my.jsp 获取 ArrayList 到 action.java
我的.jsp
<%
List left = new ArrayList(), right = new ArrayList(), l = new ArrayList();
left.add(new KeyValuePair("1key", "item1value"));
left.add(new KeyValuePair("4key", "item4value"));
left.add(new KeyValuePair("3key", "item3value"));
right.add(new KeyValuePair("2key", "item2value"));
%>
<aui:form action="<%= editListURL %>" method="post">
<liferay-ui:input-move-boxes
leftBoxName="left"
leftTitle="Left box"
leftList="<%=left %>"
rightBoxName="right"
rightTitle="Right box"
rightList="<%=right %>"
/>
<aui:button type="submit" value="send"/>
</aui:form>
动作.java
public void setSelectMyStdudent(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
try{
String left = "";
left = actionRequest.getParameter("left");
if(left.isEmpty() || left == "" || left == null) {
System.out.println("left EMPTY");
left = "0";
} else {
KeyValuePair pair = new KeyValuePair();
pair.setKey(left);
System.out.println("left = " + left);
}
} catch (Exception e) {
System.out.println("Exception: " + e);
}
}
这是代码不起作用(。请帮我做这个问题。如何从 jsp 文件中获取密钥?