struts ActionForm の速度テンプレートから文字列の配列を取得しようとしています:
私のHTMLコード:
<input type="checkbox" id="checkboxAFF01" value="AFF01" name="expert[1]">
<input type="checkbox" id="checkboxAFF02" value="AFF02" name="expert[2]">
<input type="checkbox" id="checkboxAFF03" value="AFF03" name="expert[3]">
私のアクションフォーム:
private String[] expert;
public String getExpert(int index) {
return expertise[index];
}
public void setExpert(int index, String value) {
expertise[index] = value;
}
しかし、私はこのエラーを受け取ります:
2013-02-11 14:53:10,284 ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[MainServlet] - "Servlet.service()" pour la servlet MainServlet exception
java.lang.NullPointerException
at .....setExpert(TestForm.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(PropertyUtils.java:1435)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1013)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
at com.oroad.stxx.plugin.StxxTilesRequestProcessor.processPopulate(StxxTilesRequestProcessor.java:201)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:149)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)