RE: crazy error
Remove the 'name' and 'type' attribute out of your . Why? * They are deprecated (in Struts 1.1) * If the name doesn't exactly match what you have in your config, it'll result in a new instance of the bean * You don't need it -- you action mapping definition for the allocationAction should handle it Sri -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 12:10 PM To: [EMAIL PROTECTED] Subject: crazy error Hi, I have a action calls which populates the formbean and forward to JSP where I can see the values but when I submit the jsp back to the same action the values or lost. the jsp code is ( from the javasript I can see the values I print in the alerts) and I get the value I set to "actionstr" in the action servlet but none of the other values like "product_id" or "period_end_date". What is wrong?? Regards Rajesh J function cancelr() { allo.actionstr.value="cancel"; alert(allo.period_end_date.value); alert(allo.product_id.value); allo.submit(); } MFFS Period End Date Product ID - 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: crazy error
Hi, That does not solve the problem. I have a system.out in the validate method of the bean also even ther I get null for all properties except actionstr. Does this have anything to do with the fact I am submitting the form via Javascript. Regards Rajesh J To: "Struts Users Mailing List" <[EMAIL PROTECTED]> "Sri Sankaran" cc: <[EMAIL PROTECTED] Subject: RE: crazy error m> 07 Mar 2003 12:48 PM Please respond to "Struts Users Mailing List" Remove the 'name' and 'type' attribute out of your . Why? * They are deprecated (in Struts 1.1) * If the name doesn't exactly match what you have in your config, it'll result in a new instance of the bean * You don't need it -- you action mapping definition for the allocationAction should handle it Sri -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 12:10 PM To: [EMAIL PROTECTED] Subject: crazy error Hi, I have a action calls which populates the formbean and forward to JSP where I can see the values but when I submit the jsp back to the same action the values or lost. the jsp code is ( from the javasript I can see the values I print in the alerts) and I get the value I set to "actionstr" in the action servlet but none of the other values like "product_id" or "period_end_date". What is wrong?? Regards Rajesh J function cancelr() { allo.actionstr.value="cancel"; alert(allo.period_end_date.value); alert(allo.product_id.value); allo.submit(); } MFFS Period End Date Product ID - 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: crazy error
Hi, How do u pass the bean to jsp from Action, do u pass it through request, if yes then u will loose the bean when u submit it back from jsp as it is a new request, and so loose all the values I hope this makes sense, Ashish --- [EMAIL PROTECTED] wrote: > Hi, > > I have a action calls which populates the formbean > and forward to JSP where I > can see the values but when I submit the jsp back to > the same action the values > or lost. > > the jsp code is ( from the javasript I can see the > values I print in the > alerts) and I get the value I set to "actionstr" in > the action servlet but none > of the other values like "product_id" or > "period_end_date". What is wrong?? > > Regards > Rajesh J > function cancelr() > { > allo.actionstr.value="cancel"; > alert(allo.period_end_date.value); > alert(allo.product_id.value); > allo.submit(); > } > > > > > > name="allocationActionForm" > > type="lam.mffs.form.AllocationActionForm" >styleId="allo" >scope="session"> > styleId="actionstr"/> > cellspacing="0" cellpadding="0"> > > style="color: #FF"> > face="ATSackLightRomNoBalls"> height="45" src="images/top.bmp" > border="0"/>MFFS > > > style="color: #FF"> > > > > ="center"> >cellspacing="1" bordercolor > ="#00" bordercolorlight="#00" > bordercolordark="#00"> > > width="312" bordercolor="#FF" > bordercolorlight="#FF" bordercolordark="#FF" > align="right" nowrap> > Period End Date >width="324" bordercolor=" > #FF" bordercolorlight="#FF" > bordercolordark="#FF"> >property="period_end_date" styleId > ="period_end_date" size="10"/> > > > > width="312" bordercolor="#FF" > bordercolorlight="#FF" bordercolordark="#FF" > align="right" nowrap> > Product ID >width="324" bordercolor=" > #FF" bordercolorlight="#FF" > bordercolordark="#FF"> >property="product_id" styleId="product_id" > size="10"/> > > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > = A$HI$H __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: crazy error
> Hi, > How do u pass the bean to jsp from Action, do u pass > it through request, if yes then u will loose the bean > when u submit it back from jsp as it is a new request, If your ActionForm is set to scope="request" in your ActionMapping (this is the default if not specified, I believe), then yes, the ActionForm is on the HttpServletRequest. When you submit from the JSP, the ActionForm will ONLY be populate with the values that were in the form that was submitted from the JSP. So, yes, the ActionForm from the previous request is lost. If you want to keep the data, either stick the ActionForm in session scope (not a good idea unless you are sure to remove it at some point), or use hidden fields on your forms to maintain data that will be re-populated into the ActionForm when you submit. hope this helps, Joe > > and so loose all the values > I hope this makes sense, > Ashish > --- [EMAIL PROTECTED] wrote: > > Hi, > > > > I have a action calls which populates the formbean > > and forward to JSP where I > > can see the values but when I submit the jsp back to > > the same action the values > > or lost. > > > > the jsp code is ( from the javasript I can see the > > values I print in the > > alerts) and I get the value I set to "actionstr" in > > the action servlet but none > > of the other values like "product_id" or > > "period_end_date". What is wrong?? > > > > Regards > > Rajesh J > > function cancelr() > > { > > allo.actionstr.value="cancel"; > > alert(allo.period_end_date.value); > > alert(allo.product_id.value); > > allo.submit(); > > } > > > > > > > > > > > > >name="allocationActionForm" > > > > type="lam.mffs.form.AllocationActionForm" > >styleId="allo" > >scope="session"> > > > styleId="actionstr"/> > > > cellspacing="0" cellpadding="0"> > > > > > style="color: #FF"> > > > face="ATSackLightRomNoBalls"> > height="45" src="images/top.bmp" > > border="0"/>MFFS > > > > > > > style="color: #FF"> > > > > > > > > > ="center"> > >> cellspacing="1" bordercolor > > ="#00" bordercolorlight="#00" > > bordercolordark="#00"> > > > > > width="312" bordercolor="#FF" > > bordercolorlight="#FF" bordercolordark="#FF" > > align="right" nowrap> > > Period End Date > >> width="324" bordercolor=" > > #FF" bordercolorlight="#FF" > > bordercolordark="#FF"> > >> property="period_end_date" styleId > > ="period_end_date" size="10"/> > > > > > > > > > width="312" bordercolor="#FF" > > bordercolorlight="#FF" bordercolordark="#FF" > > align="right" nowrap> > > Product ID > >> width="324" bordercolor=" > > #FF" bordercolorlight="#FF" > > bordercolordark="#FF"> > >> property="product_id" styleId="product_id" > > size="10"/> > > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > = > A$HI$H > > __ > Do you Yahoo!? > Yahoo! Tax Center - forms, calculators, tips, more > http://taxes.yahoo.com/ > > - > 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: crazy error
session is the default mark -Original Message- From: Joe Barefoot [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 2:10 PM To: Struts Users Mailing List Subject: RE: crazy error > Hi, > How do u pass the bean to jsp from Action, do u pass > it through request, if yes then u will loose the bean > when u submit it back from jsp as it is a new request, If your ActionForm is set to scope="request" in your ActionMapping (this is the default if not specified, I believe), then yes, the ActionForm is on the HttpServletRequest. When you submit from the JSP, the ActionForm will ONLY be populate with the values that were in the form that was submitted from the JSP. So, yes, the ActionForm from the previous request is lost. If you want to keep the data, either stick the ActionForm in session scope (not a good idea unless you are sure to remove it at some point), or use hidden fields on your forms to maintain data that will be re-populated into the ActionForm when you submit. hope this helps, Joe > > and so loose all the values > I hope this makes sense, > Ashish > --- [EMAIL PROTECTED] wrote: > > Hi, > > > > I have a action calls which populates the formbean > > and forward to JSP where I > > can see the values but when I submit the jsp back to > > the same action the values > > or lost. > > > > the jsp code is ( from the javasript I can see the > > values I print in the > > alerts) and I get the value I set to "actionstr" in > > the action servlet but none > > of the other values like "product_id" or > > "period_end_date". What is wrong?? > > > > Regards > > Rajesh J > > function cancelr() > > { > > allo.actionstr.value="cancel"; > > alert(allo.period_end_date.value); > > alert(allo.product_id.value); > > allo.submit(); > > } > > > > > > > > > > > > >name="allocationActionForm" > > > > type="lam.mffs.form.AllocationActionForm" > >styleId="allo" > >scope="session"> > > > styleId="actionstr"/> > > > cellspacing="0" cellpadding="0"> > > > > > style="color: #FF"> > > > width="61" height="45" src="images/top.bmp" > > border="0"/>MFFS > > > > > > > style="color: #FF"> > > > > > > > > > ="center"> > >> cellspacing="1" bordercolor > > ="#00" bordercolorlight="#00" > > bordercolordark="#00"> > > > > > width="312" bordercolor="#FF" > > bordercolorlight="#FF" bordercolordark="#FF" > > align="right" nowrap> > > Period End Date > >> width="324" bordercolor=" > > #FF" bordercolorlight="#FF" > > bordercolordark="#FF"> > >> property="period_end_date" styleId > > ="period_end_date" size="10"/> > > > > > > > > > width="312" bordercolor="#FF" > > bordercolorlight="#FF" bordercolordark="#FF" > > align="right" nowrap> > > Product ID > >> width="324" bordercolor=" > > #FF" bordercolorlight="#FF" > > bordercolordark="#FF"> > >> property="product_id" styleId="product_id" > > size="10"/> > > > > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > = > A$HI$H > > __ > Do you Yahoo!? > Yahoo! Tax Center - forms, calculators, tips, more > http://taxes.yahoo.com/ > > - > 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: crazy error
thanks. For the record, I don't condone relying on defaults. Never leave to assumption what you can explicitly specify. :) --joe > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: Friday, March 07, 2003 11:14 AM > To: 'Struts Users Mailing List' > Subject: RE: crazy error > > > session is the default > > mark > > -Original Message- > From: Joe Barefoot [mailto:[EMAIL PROTECTED] > Sent: Friday, March 07, 2003 2:10 PM > To: Struts Users Mailing List > Subject: RE: crazy error > > > > > Hi, > > How do u pass the bean to jsp from Action, do u pass > > it through request, if yes then u will loose the bean > > when u submit it back from jsp as it is a new request, > > If your ActionForm is set to scope="request" in your > ActionMapping (this is > the default if not specified, I believe), then yes, the > ActionForm is on the > HttpServletRequest. When you submit from the JSP, the > ActionForm will ONLY > be populate with the values that were in the form that was > submitted from > the JSP. So, yes, the ActionForm from the previous request is lost. > > If you want to keep the data, either stick the ActionForm in > session scope > (not a good idea unless you are sure to remove it at some > point), or use > hidden fields on your forms to maintain data that will be > re-populated into > the ActionForm when you submit. > > > > hope this helps, > Joe > > > > > > and so loose all the values > > I hope this makes sense, > > Ashish > > --- [EMAIL PROTECTED] wrote: > > > Hi, > > > > > > I have a action calls which populates the formbean > > > and forward to JSP where I > > > can see the values but when I submit the jsp back to > > > the same action the values > > > or lost. > > > > > > the jsp code is ( from the javasript I can see the > > > values I print in the > > > alerts) and I get the value I set to "actionstr" in > > > the action servlet but none > > > of the other values like "product_id" or > > > "period_end_date". What is wrong?? > > > > > > Regards > > > Rajesh J > > > function cancelr() > > > { > > > allo.actionstr.value="cancel"; > > > alert(allo.period_end_date.value); > > > alert(allo.product_id.value); > > > allo.submit(); > > > } > > > > > > > > > > > > > > > > > > > >name="allocationActionForm" > > > > > > type="lam.mffs.form.AllocationActionForm" > > >styleId="allo" > > >scope="session"> > > > > > styleId="actionstr"/> > > > > > cellspacing="0" cellpadding="0"> > > > > > > > > style="color: #FF"> > > > face="ATSackLightRomNoBalls"> > > width="61" height="45" src="images/top.bmp" > > > border="0"/>MFFS > > > > > > > > > > > style="color: #FF"> > > > > > > > > > > > > > > ="center"> > > >> > cellspacing="1" bordercolor > > > ="#00" bordercolorlight="#00" > > > bordercolordark="#00"> > > > > > > > > width="312" bordercolor="#FF" > > > bordercolorlight="#FF" bordercolordark="#FF" > > > align="right" nowrap> > > > Period End Date > > >> > width="324" bordercolor=" > > > #FF" bordercolorlight="#FF" > > > bordercolordark="#FF"> > > >> > property="period_end_date" styleId > > > ="period_end_date" size="10"/> > > > > > > > > > > > > > > width="312" bordercolor="#FF" > > > bordercolorlight="#FF" bordercolordark="#FF" > > > align="right" nowrap> > > > Product ID > > >> > width="324" bordercolor=" > > > #FF" bordercolorlight="#FF" > > > bordercolordark="#FF"> > > >> > property="product_id" styleId="product_id" > > > size="10"/> > > > > > > > > > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > = > > A$HI$H > > > > __ > > Do you Yahoo!? > > Yahoo! Tax Center - forms, calculators, tips, more > > http://taxes.yahoo.com/ > > > > > - > > 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]
RE: crazy error
no argument here! I initialize every variable...in any language. -Original Message- From: Joe Barefoot [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 2:22 PM To: Struts Users Mailing List Subject: RE: crazy error thanks. For the record, I don't condone relying on defaults. Never leave to assumption what you can explicitly specify. :) --joe > -Original Message- > From: Mark Galbreath [mailto:[EMAIL PROTECTED] > Sent: Friday, March 07, 2003 11:14 AM > To: 'Struts Users Mailing List' > Subject: RE: crazy error > > > session is the default > > mark > > -Original Message- > From: Joe Barefoot [mailto:[EMAIL PROTECTED] > Sent: Friday, March 07, 2003 2:10 PM > To: Struts Users Mailing List > Subject: RE: crazy error > > > > > Hi, > > How do u pass the bean to jsp from Action, do u pass > > it through request, if yes then u will loose the bean > > when u submit it back from jsp as it is a new request, > > If your ActionForm is set to scope="request" in your > ActionMapping (this is > the default if not specified, I believe), then yes, the > ActionForm is on the > HttpServletRequest. When you submit from the JSP, the > ActionForm will ONLY > be populate with the values that were in the form that was > submitted from > the JSP. So, yes, the ActionForm from the previous request is lost. > > If you want to keep the data, either stick the ActionForm in > session scope > (not a good idea unless you are sure to remove it at some > point), or use > hidden fields on your forms to maintain data that will be > re-populated into > the ActionForm when you submit. > > > > hope this helps, > Joe > > > > > > and so loose all the values > > I hope this makes sense, > > Ashish > > --- [EMAIL PROTECTED] wrote: > > > Hi, > > > > > > I have a action calls which populates the formbean > > > and forward to JSP where I > > > can see the values but when I submit the jsp back to > > > the same action the values > > > or lost. > > > > > > the jsp code is ( from the javasript I can see the values I print > > > in the > > > alerts) and I get the value I set to "actionstr" in > > > the action servlet but none > > > of the other values like "product_id" or "period_end_date". What > > > is wrong?? > > > > > > Regards > > > Rajesh J > > > function cancelr() > > > { > > > allo.actionstr.value="cancel"; > > > alert(allo.period_end_date.value); > > > alert(allo.product_id.value); > > > allo.submit(); > > > } > > > > > > > > > > > > > > > > > > > >name="allocationActionForm" > > > > > > type="lam.mffs.form.AllocationActionForm" > > >styleId="allo" > > >scope="session"> > > > > > styleId="actionstr"/> > > > > > cellpadding="0"> > > > > > > > > style="color: #FF"> > > > face="ATSackLightRomNoBalls"> > > width="61" height="45" src="images/top.bmp" > > > border="0"/>MFFS > > > > > > > > > > > style="color: #FF"> > > > > > > > > > > > > > > ="center"> > > >> > cellspacing="1" bordercolor ="#00" bordercolorlight="#00" > > > bordercolordark="#00"> > > > > > > > > width="312" bordercolor="#FF" > > > bordercolorlight="#FF" bordercolordark="#FF" > > > align="right" nowrap> > > > Period End Date > > >> > width="324" bordercolor=" > > > #FF" bordercolorlight="#FF" > > > bordercolordark="#FF"> > > >> > property="period_end_date" styleId > > > ="period_end_date" size="10"/> > > > > > > > > > > > > > > width="312" bordercolor="#FF" > > > bordercolorlight="#FF" bordercolordar
RE: crazy error
Hi, The scope to session until I have finished testing.. The feild in the jsp page are directly related to the field int he formbean.. so on submitting it should be populated automatically.. which is not happening. I found this is because I of conversionexception so when I created a servlet extending actionservlet and public void init() throws ServletException { super.init(); ConvertUtils.register(new BigDecimalConverter(null), java.math.BigDecimal.class); } added the above method the problem has disappeared. Regards Rajesh J To: "Struts Users Mailing List" <[EMAIL PROTECTED]> "Joe Barefoot"cc: <[EMAIL PROTECTED] Subject: RE: crazy error om> 07 Mar 2003 02:10 PM Please respond to "Struts Users Mailing List" > Hi, > How do u pass the bean to jsp from Action, do u pass > it through request, if yes then u will loose the bean > when u submit it back from jsp as it is a new request, If your ActionForm is set to scope="request" in your ActionMapping (this is the default if not specified, I believe), then yes, the ActionForm is on the HttpServletRequest. When you submit from the JSP, the ActionForm will ONLY be populate with the values that were in the form that was submitted from the JSP. So, yes, the ActionForm from the previous request is lost. If you want to keep the data, either stick the ActionForm in session scope (not a good idea unless you are sure to remove it at some point), or use hidden fields on your forms to maintain data that will be re-populated into the ActionForm when you submit. hope this helps, Joe > > and so loose all the values > I hope this makes sense, > Ashish > --- [EMAIL PROTECTED] wrote: > > Hi, > > > > I have a action calls which populates the formbean > > and forward to JSP where I > > can see the values but when I submit the jsp back to > > the same action the values > > or lost. > > > > the jsp code is ( from the javasript I can see the > > values I print in the > > alerts) and I get the value I set to "actionstr" in > > the action servlet but none > > of the other values like "product_id" or > > "period_end_date". What is wrong?? > > > > Regards > > Rajesh J > > function cancelr() > > { > > allo.actionstr.value="cancel"; > > alert(allo.period_end_date.value); > > alert(allo.product_id.value); > > allo.submit(); > > } > > > > > > > > > > > > >name="allocationActionForm" > > > > type="lam.mffs.form.AllocationActionForm" > >styleId="allo" > >scope="session"> > > > styleId="actionstr"/> > > > cellspacing="0" cellpadding="0"> > > > > > style="color: #FF"> > > > face="ATSackLightRomNoBalls"> > height="45" src="images/top.bmp" > > border="0"/>MFFS > > > > > > > style="color: #FF"> > > > > > > > > > ="center"> > >> cellspacing="1" bordercolor > > ="#00" bordercolorlight="#00" > > bordercolordark="#00"> > > > > > width="312" bordercolor="#FF" > > bordercolorl