dcsimg
dynamic options stored in forms
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raphael_Carruzzo
Posted On:   Thursday, November 22, 2001 11:13 AM

Hi! In my application, I save the dynamic options (value list) in an ActionForm (as a Collection). My JSP look like that: When I create a new from, it works well. But if I submit the Form and the validation fails, I get the following error: javax.servlet.ServletException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) at _0002fsubject_0002ejspsubject_jsp_41._jspService(_0002fsubject_0002ejspsubject_jsp_41.java:2399) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServl   More>>

Hi!


In my application, I save the dynamic options (value list) in an ActionForm (as a Collection).


My JSP look like that:






When I create a new from, it works well. But if I submit the Form and the validation fails, I get the following error:
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fsubject_0002ejspsubject_jsp_41._jspService(_0002fsubject_0002ejspsubject_jsp_41.java:2399)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:222)
at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162)
at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2149)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

Cause racine:
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:380)
at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:258)
at org.apache.struts.taglib.bean.DefineTag.doStartTag(DefineTag.java:210)
at _0002fsubject_0002ejspsubject_jsp_41._jspService(_0002fsubject_0002ejspsubject_jsp_41.java:1228)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.facade.RequestDispatcherImpl.doForward(RequestDispatcherImpl.java:222)
at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:162)
at org.apache.struts.action.ActionServlet.processValidate(ActionServlet.java:2149)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)


Please help me quickly, I'm doing my diploma work with Struts!


Thanks


R. Carruzzo

   <<Less

Re: dynamic options stored in forms

Posted By:   Ted_Husted  
Posted On:   Monday, November 26, 2001 02:04 PM

On the way to validation, the form is reduced to a
HTTP request, and then repopulated. The collection
is not passed through the HTTP request, and so ends up
null.


You can use an Action as the input path,
and have the Action put the collection back into the form
before it goes back to the JSP.


HTH -Ted

About | Sitemap | Contact