commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject 2 dimension array of object
Date Thu, 14 Sep 2006 14:49:29 GMT
Does anyone knows how I can access a property in an object contained in a 2 dimension array?
 
My array (sampleMatrix) is defined like this : private PlateSpot[][] sampleMatrix = new PlateSpot[ROW_SIZE][COLUMN_SIZE];
It has the normal getter and setter.
 
When accessing this property: PropertyUtils.getNestedProperty(moleculeTreatmentForm, "pmPlate.sampleMatrix[0][0].id").
I get this exception. Note that PlateSpot has the id property.
java.lang.NoSuchMethodException: Unknown property 'id'

at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1122)

at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)

at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:272)

at org.apache.jsp.pages.proteomic.sample.treatment.molecule.treatment_jsp._jspService(treatment_jsp.java:480)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)

at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)

at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)

at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)

at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)

at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)

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:709)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

at java.lang.Thread.run(Thread.java:595)

 
 
Another curious behaviour is that if I access the parent property (in this case : PropertyUtils.getNestedProperty(moleculeTreatmentForm,
"pmPlate.sampleMatrix[0][0]")) I get the array corresponding to the pmPlate.sampleMatrix[0]
property which is not what I expect...
 
 
Thanks.
Christian Poitras
Institut de recherches cliniques de Montréal (IRCM)
Christian.Poitras@ircm.qc.ca
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message