Re: convertNull problems
Not sure if this was recently fixed, but I just verified that it works fine with the nightly build. I can provide a modified struts-example that validates this (if you like). I'm sure you are aware of why you would not want to use form fields other than String, but I thought I would mention it. -- James Mitchell - Original Message - From: "Ben Sion" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 7:27 PM Subject: convertNull problems > struts 1.1b3 > > From: James Mitchell <[EMAIL PROTECTED]> > Subject: convertNull problems > Date: Tue, 11 Feb 2003 17:16:48 -0500 > Content-Type: text/plain; > charset="iso-8859-1" > > > What version of Struts are you using? > > > -- > James Mitchell > > > > > > - Original Message - > From: "Ben Sion" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, February 11, 2003 5:08 PM > Subject: convertNull problems > > > > I am try trying to use the "convertNull" parameter of ActionServlet, so > that > > when the user does not enter a value into a field that is mapped to an > > attribute of type Long in my form, the attribute = null rather than 0. > > However I am getting conversion errors. The excerpt from my sevlet log: > > > > Feb 12 11:07:24 2003: The ServletException contained the following root > > cause exception: > > Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: > For > > input string: "" > > at > > > org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter. > > java:149) > > at > org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) > > at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) > > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) > > at > > > org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j > > ava:798) > > at > > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) > > 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) > > at > > > com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher. > > java:922) > > at > com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) > > at > > com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) > > at > com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) > > at > com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) > > at > > > com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.ja > > va:52) > > at > > > > The action servlet definition in my web.xml looks like this: > > ... > > > > action > > org.apache.struts.action.ActionServlet > > > > config > > /WEB-INF/struts-config.xml > > > > > > debug > > 2 > > > > > > detail > > 2 > > > > > > convertNull > > true > > > > 2 > > > > ... > > > > and my form: > > public final class InputParametersForm extends ValidatorActionForm { > > > > private Long batchNumber; > > private Long organisationCode; > > private Long status; > > ... > > > > > > Any suggestions? > > > > thanks in advance > > Ben > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
convertNull problems
I believe I am. This is the extract from my web.xml: ... action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 2 detail 2 convertNull true 2 ... From: Brian Lee <[EMAIL PROTECTED]> Subject: convertNull problems Date: Tue, 11 Feb 2003 17:51:56 -0500 Content-Type: text/plain; format=flowed Did you set convertNull=true for the ActionServlet in the web.xml. BAL >From: Ben Sion <[EMAIL PROTECTED]> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: convertNull problems >Date: Wed, 12 Feb 2003 11:08:43 +1300 > >I am try trying to use the "convertNull" parameter of ActionServlet, so >that >when the user does not enter a value into a field that is mapped to an >attribute of type Long in my form, the attribute = null rather than 0. >However I am getting conversion errors. The excerpt from my sevlet log: > >Feb 12 11:07:24 2003: The ServletException contained the following root >cause exception: >Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: For >input string: "" > at >org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter . >java:149) > at >org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) > at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) > at >org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor. j >ava:798) > at >org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254 ) > 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) > at >com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher . >java:922) > at >com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) > at >com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) > at >com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) > at >com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) > at >com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.j a >va:52) > at > >The action servlet definition in my web.xml looks like this: > ... > > action > org.apache.struts.action.ActionServlet > > config > /WEB-INF/struts-config.xml > > > debug > 2 > > > detail > 2 > > > convertNull > true > > 2 > > ... > >and my form: > public final class InputParametersForm extends ValidatorActionForm { > > private Long batchNumber; > private Long organisationCode; > private Long status; > ... > > >Any suggestions? > >thanks in advance >Ben > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
convertNull problems
struts 1.1b3 From: James Mitchell <[EMAIL PROTECTED]> Subject: convertNull problems Date: Tue, 11 Feb 2003 17:16:48 -0500 Content-Type: text/plain; charset="iso-8859-1" What version of Struts are you using? -- James Mitchell - Original Message - From: "Ben Sion" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 5:08 PM Subject: convertNull problems > I am try trying to use the "convertNull" parameter of ActionServlet, so that > when the user does not enter a value into a field that is mapped to an > attribute of type Long in my form, the attribute = null rather than 0. > However I am getting conversion errors. The excerpt from my sevlet log: > > Feb 12 11:07:24 2003: The ServletException contained the following root > cause exception: > Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: For > input string: "" > at > org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter. > java:149) > at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) > at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) > at > org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j > ava:798) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) > 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) > at > com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher. > java:922) > at com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) > at > com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) > at com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) > at com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) > at > com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.ja > va:52) > at > > The action servlet definition in my web.xml looks like this: > ... > > action > org.apache.struts.action.ActionServlet > > config > /WEB-INF/struts-config.xml > > > debug > 2 > > > detail > 2 > > > convertNull > true > > 2 > > ... > > and my form: > public final class InputParametersForm extends ValidatorActionForm { > > private Long batchNumber; > private Long organisationCode; > private Long status; > ... > > > Any suggestions? > > thanks in advance > Ben > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: convertNull problems
Did you set convertNull=true for the ActionServlet in the web.xml. BAL From: Ben Sion <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: convertNull problems Date: Wed, 12 Feb 2003 11:08:43 +1300 I am try trying to use the "convertNull" parameter of ActionServlet, so that when the user does not enter a value into a field that is mapped to an attribute of type Long in my form, the attribute = null rather than 0. However I am getting conversion errors. The excerpt from my sevlet log: Feb 12 11:07:24 2003: The ServletException contained the following root cause exception: Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: For input string: "" at org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter. java:149) at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) at com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher. java:922) at com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) at com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) at com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) at com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) at com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.ja va:52) at The action servlet definition in my web.xml looks like this: ... action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 2 detail 2 convertNull true 2 ... and my form: public final class InputParametersForm extends ValidatorActionForm { private Long batchNumber; private Long organisationCode; private Long status; ... Any suggestions? thanks in advance Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: convertNull problems
What version of Struts are you using? -- James Mitchell - Original Message - From: "Ben Sion" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 5:08 PM Subject: convertNull problems > I am try trying to use the "convertNull" parameter of ActionServlet, so that > when the user does not enter a value into a field that is mapped to an > attribute of type Long in my form, the attribute = null rather than 0. > However I am getting conversion errors. The excerpt from my sevlet log: > > Feb 12 11:07:24 2003: The ServletException contained the following root > cause exception: > Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: For > input string: "" > at > org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter. > java:149) > at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) > at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) > at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) > at > org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j > ava:798) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) > 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) > at > com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher. > java:922) > at com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) > at > com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) > at com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) > at com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) > at > com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.ja > va:52) > at > > The action servlet definition in my web.xml looks like this: > ... > > action > org.apache.struts.action.ActionServlet > > config > /WEB-INF/struts-config.xml > > > debug > 2 > > > detail > 2 > > > convertNull > true > > 2 > > ... > > and my form: > public final class InputParametersForm extends ValidatorActionForm { > > private Long batchNumber; > private Long organisationCode; > private Long status; > ... > > > Any suggestions? > > thanks in advance > Ben > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
convertNull problems
I am try trying to use the "convertNull" parameter of ActionServlet, so that when the user does not enter a value into a field that is mapped to an attribute of type Long in my form, the attribute = null rather than 0. However I am getting conversion errors. The excerpt from my sevlet log: Feb 12 11:07:24 2003: The ServletException contained the following root cause exception: Feb 12 11:07:24 2003: org.apache.commons.beanutils.ConversionException: For input string: "" at org.apache.commons.beanutils.converters.LongConverter.convert(LongConverter. java:149) at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:359) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:615) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j ava:798) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) 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 com.sybase.jaguar.servlet.JagServlet.service(JagServlet.java:656) at com.sybase.jaguar.servlet.JagRequestDispatcher.service(JagRequestDispatcher. java:922) at com.sybase.jaguar.servlet.JagWebResource.service(JagWebResource.java:90) at com.sybase.jaguar.servlet.JagFilterChain.doFilter(JagFilterChain.java:131) at com.sybase.jaguar.servlet.ServletEngine._service(ServletEngine.java:804) at com.sybase.jaguar.servlet.ServletEngine.service(ServletEngine.java:338) at com.sybase.jaguar.servlet.ServletServiceImpl.doService(ServletServiceImpl.ja va:52) at The action servlet definition in my web.xml looks like this: ... action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 2 detail 2 convertNull true 2 ... and my form: public final class InputParametersForm extends ValidatorActionForm { private Long batchNumber; private Long organisationCode; private Long status; ... Any suggestions? thanks in advance Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]