struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From O_Parthasarathy Kesavaraj <Parthasarat...@PLANETASIA.COM>
Subject Problem in Iterating over a form bean property
Date Wed, 25 Jun 2003 14:47:29 GMT
Hai
I have not received any replies.let me put my question like this.is it
possible to iterate over an ArrayList which is my form bean's property
Regards
Partha

In formbean i am having an arraylist that contains a value object having id
and name.I am loading that in my jsp.The code goed like this.

<logic:iterate id="element"  property="userAdmins">
<TR>
	<TD><bean:write name="element" property="id"/> </TD> 
	<TD><bean:write name="element" property="name"/><BR></TD>
</TR>
</logic:iterate>
Here userAdmins is the ArrayList containing an instance of my value object
VO.vo has setId and setName and corresponding getters.I am getting the
following exception.
java.lang.NullPointerException
	at java.util.Hashtable.get(Hashtable.java:329)
	at
org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.java
:308)
	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:787)
	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:835)
	at
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:300)
	at
org.apache.jsp.user_admins_jsp._jspService(user_admins_jsp.java:207)
	at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:432)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:356)
	at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
33)
	at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:436)
	at
org.apache.struts.action.RequestProcessor.processActionForward(RequestProces
sor.java:401)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
	at java.lang.Thread.run(Thread.java:536)

Please Help.
Regards
Partha


> ----------
> From: 	O_Parthasarathy Kesavaraj
> Reply To: 	Struts Users Mailing List
> Sent: 	Wednesday, June 25, 2003 7:02 PM
> To: 	'Struts Users Mailing List'
> Subject: 	Proble in Iterating over a form bean property
> 
> Hai
> In formbean i am having an arraylist that contains a value object having
> id
> and name.I am loading that in my jsp.The code goed like this.
> 
> <logic:iterate id="element"  property="userAdmins">
> <TR>
> 	<TD><bean:write name="element" property="id"/> </TD> 
> 	<TD><bean:write name="element" property="name"/><BR></TD>
> </TR>
> </logic:iterate>
> Here userAdmins is the ArrayList containing an instance of my value object
> VO.vo has setId and setName and corresponding getters.I am getting the
> following exception.
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:329)
> 	at
> org.apache.jasper.runtime.PageContextImpl.findAttribute(PageContextImpl.ja
> va
> :308)
> 	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:787)
> 	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:835)
> 	at
> org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:300)
> 	at
> org.apache.jsp.user_admins_jsp._jspService(user_admins_jsp.java:207)
> 	at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
> :2
> 10)
> 	at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatche
> r.
> java:684)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispat
> ch
> er.java:432)
> 	at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatch
> er
> .java:356)
> 	at
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:
> 10
> 33)
> 	at
> org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProc
> es
> sor.java:436)
> 	at
> org.apache.struts.action.RequestProcessor.processActionForward(RequestProc
> es
> sor.java:401)
> 	at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:27
> 9)
> 	at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
> 	at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
> on
> FilterChain.java:247)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
> Ch
> ain.java:193)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
> ja
> va:256)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
> ja
> va:191)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1
> 80
> )
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValv
> e.
> java:171)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1
> 72
> )
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:641)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja
> va
> :174)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.inv
> ok
> eNext(StandardPipeline.java:643)
> 	at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480
> )
> 	at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> 	at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processCon
> ne
> ction(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.j
> av
> a:619)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> Please Help.
> Regards
> Partha
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message