Displaying Content only if form errors are present
Hi, I'm trying to display a piece of HTML only if the previous form submit create an ActionError. This is what I got so far: logic:present name=%=org.apache.struts.Globals.ERROR_KEY% td class=errorhtml:errors property=company //td /logic:present tdCompany:/tdtdhtml:text property=company//td this works, but seems not the cleanest way to do this to me. Does anyone know a better way, e.g. a custom tag for this. BTW I tried this with JSTL core, too, but couldn't get it to work: c:if test=${!empty $org.apache.struts.action.ERROR} evaluates always to false. Does anyone know how to get this to work with JSTL? thanks in advance, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying Content only if form errors are present
logic:messagesPresent ? -Original Message- From: Christoph Kutzinski [mailto:[EMAIL PROTECTED] Sent: 23 March 2004 17:51 To: Struts Users Mailing List Subject: Displaying Content only if form errors are present Hi, I'm trying to display a piece of HTML only if the previous form submit create an ActionError. This is what I got so far: logic:present name=%=org.apache.struts.Globals.ERROR_KEY% td class=errorhtml:errors property=company //td /logic:present tdCompany:/tdtdhtml:text property=company//td this works, but seems not the cleanest way to do this to me. Does anyone know a better way, e.g. a custom tag for this. BTW I tried this with JSTL core, too, but couldn't get it to work: c:if test=${!empty $org.apache.struts.action.ERROR} evaluates always to false. Does anyone know how to get this to work with JSTL? thanks in advance, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying Content only if form errors are present
That works, thanks a lot. I overlooked this tag in the Struts docs ;-( Irving, Dave wrote: logic:messagesPresent ? -Original Message- From: Christoph Kutzinski [mailto:[EMAIL PROTECTED] Sent: 23 March 2004 17:51 To: Struts Users Mailing List Subject: Displaying Content only if form errors are present Hi, I'm trying to display a piece of HTML only if the previous form submit create an ActionError. This is what I got so far: logic:present name=%=org.apache.struts.Globals.ERROR_KEY% td class=errorhtml:errors property=company //td /logic:present tdCompany:/tdtdhtml:text property=company//td this works, but seems not the cleanest way to do this to me. Does anyone know a better way, e.g. a custom tag for this. BTW I tried this with JSTL core, too, but couldn't get it to work: c:if test=${!empty $org.apache.struts.action.ERROR} evaluates always to false. Does anyone know how to get this to work with JSTL? thanks in advance, Christoph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - 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]
Displaying properties in a nested iterator
How do nest iterators? An exert from my jsp... logic:iterate property=orders name=allocationOrder id=element .. .. do stuff with element .. .. logic:iterate property=orderDetails name=element id=subElement .. .. do with with subElement .. /logic:iterator .. /logic:iterate The problem is that although the _number_ of elements in the nested iterator is correct, if I try and do bean:write name=subElement property=orderNo/ I get a No getter method for property orderNoof bean subElement exception. I noticed that there is a nested tag library, and I've tried to utilise this, but with no success. How do you successfully nest iterators and display properties in the nested iterator? I don't want to use a scriptlet. Read our disclaimer at: http://www.picknpay.co.za/email-disclaimer.htm If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying properties in a nested iterator
the class for the contents of the nested form was not public! On Wed, 2004-02-04 at 12:35, Michael Wiles wrote: How do nest iterators? An exert from my jsp... logic:iterate property=orders name=allocationOrder id=element .. .. do stuff with element .. .. logic:iterate property=orderDetails name=element id=subElement .. .. do with with subElement .. /logic:iterator .. /logic:iterate The problem is that although the _number_ of elements in the nested iterator is correct, if I try and do bean:write name=subElement property=orderNo/ I get a No getter method for property orderNoof bean subElement exception. I noticed that there is a nested tag library, and I've tried to utilise this, but with no success. How do you successfully nest iterators and display properties in the nested iterator? I don't want to use a scriptlet. Read our disclaimer at: http://www.picknpay.co.za/email-disclaimer.htm If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Read our disclaimer at: http://www.picknpay.co.za/email-disclaimer.htm If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to [EMAIL PROTECTED] -- Michael Wiles [EMAIL PROTECTED] Pick 'n Pay IS - 1665 Read our disclaimer at: http://www.picknpay.co.za/email-disclaimer.htm If you don't have web access, the disclaimer can be mailed to you on request. Disclaimer requests to be sent to [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(resend) Validator JavaScript displaying? Mozilla bug?
Hi folks, I am having a problem with Mozilla, Netscape, and FireBird browsers on pages that use the validator JavaScript. It seems that the browsers choke on all that script and end up displaying the script instead of the page content ( even though the script is guarded by the HTML comments) about 80% of the time. Please see: http://www.bulliondirect.com/catalog/showProducts.do?category=1 When I have a garbled page, I look at the page source, and the source looks fine. The page validates as HTML 4.01 Transitional compliant via: http://validator.w3.org/file-upload.html http://validator.w3.org/detailed.html The only way I can get it to display correctly, is to keep hitting reload until it renders correctly, but the page source is always the same by file comparison. If you File-Save a garbled page, and load it from file, it renders correctly. IE does not have this problem, and I cannot find any evidence that any one else has ever experienced this either. What makes our pages a special case? I know all the affected browsers are related in some way, do they share some sort of common bug (In Gecko I presume)? Can anyone confirm they see what I see? Anyone have a similar experience? BugZilla (http://bugzilla.mozilla.org/) is rather difficult for me to use, so I haven't been able to use it well enough to find reports of this. Tested Browsers: Mozilla 1.5 Gecko/20030916 FireBird 0.7 Gecko/20031007 Netscape 7.1 Gecko/20030624
Re: (resend) Validator JavaScript displaying? Mozilla bug?
Doesn't look like the script is commented properly. I changed: !-- Begin To just: !-- and it rendered properly in Firebird .7 Did you add Begin or did Validator? Curious, because I'm a Struts newbie and plan on using Validator soon. Regards, -Ryan Hi folks, I am having a problem with Mozilla, Netscape, and FireBird browsers on pages that use the validator JavaScript. It seems that the browsers choke on all that script and end up displaying the script instead of the page content ( even though the script is guarded by the HTML comments) about 80% of the time. Please see: http://www.bulliondirect.com/catalog/showProducts.do?category=1 When I have a garbled page, I look at the page source, and the source looks fine. The page validates as HTML 4.01 Transitional compliant via: http://validator.w3.org/file-upload.html http://validator.w3.org/detailed.html The only way I can get it to display correctly, is to keep hitting reload until it renders correctly, but the page source is always the same by file comparison. If you File-Save a garbled page, and load it from file, it renders correctly. IE does not have this problem, and I cannot find any evidence that any one else has ever experienced this either. What makes our pages a special case? I know all the affected browsers are related in some way, do they share some sort of common bug (In Gecko I presume)? Can anyone confirm they see what I see? Anyone have a similar experience? BugZilla (http://bugzilla.mozilla.org/) is rather difficult for me to use, so I haven't been able to use it well enough to find reports of this. Tested Browsers: Mozilla 1.5 Gecko/20030916 FireBird 0.7 Gecko/20031007 Netscape 7.1 Gecko/20030624 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (resend) Validator JavaScript displaying? Mozilla bug?
Ok, I lied. I neglected to check the local copy of your page prior to making the edit. Bad on me. In sum, visiting the page in Firebird 0.7 displays the script as stated. Saving the page as a local file then opening and the page seems to behave as expected. ?? -Ryan Doesn't look like the script is commented properly. I changed: !-- Begin To just: !-- and it rendered properly in Firebird .7 Did you add Begin or did Validator? Curious, because I'm a Struts newbie and plan on using Validator soon. Regards, -Ryan Hi folks, I am having a problem with Mozilla, Netscape, and FireBird browsers on pages that use the validator JavaScript. It seems that the browsers choke on all that script and end up displaying the script instead of the page content ( even though the script is guarded by the HTML comments) about 80% of the time. Please see: http://www.bulliondirect.com/catalog/showProducts.do?category=1 When I have a garbled page, I look at the page source, and the source looks fine. The page validates as HTML 4.01 Transitional compliant via: http://validator.w3.org/file-upload.html http://validator.w3.org/detailed.html The only way I can get it to display correctly, is to keep hitting reload until it renders correctly, but the page source is always the same by file comparison. If you File-Save a garbled page, and load it from file, it renders correctly. IE does not have this problem, and I cannot find any evidence that any one else has ever experienced this either. What makes our pages a special case? I know all the affected browsers are related in some way, do they share some sort of common bug (In Gecko I presume)? Can anyone confirm they see what I see? Anyone have a similar experience? BugZilla (http://bugzilla.mozilla.org/) is rather difficult for me to use, so I haven't been able to use it well enough to find reports of this. Tested Browsers: Mozilla 1.5 Gecko/20030916 FireBird 0.7 Gecko/20031007 Netscape 7.1 Gecko/20030624 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] |--| | Ryan Russo | | [EMAIL PROTECTED]| | University at Albany--Computing | | remove [noSPAM] to e-mail| | Technical Services Web Team | |__| - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator JavaScript displaying? Mozilla bug?
Hi folks, I am having a problem with Mozilla, Netscape, and FireBird browsers on pages that use the validator JavaScript. It seems that the browsers choke on all that script and end up displaying the script instead of the page content ( even though the script is guarded by the HTML comments) about 80% of the time. Please see: http://www.bulliondirect.com/catalog/showProducts.do?category=1 When I have a garbled page, I look at the page source, and the source looks fine. The page validates as HTML 4.01 Transitional compliant via: http://validator.w3.org/file-upload.html http://validator.w3.org/detailed.html The only way I can get it to display correctly, is to keep hitting reload until it renders correctly, but the page source is always the same by file comparison. If you File-Save a garbled page, and load it from file, it renders correctly. IE does not have this problem, and I cannot find any evidence that any one else has ever experienced this either. What makes our pages a special case? I know all the affected browsers are related in some way, do they share some sort of common bug (In Gecko I presume)? Can anyone confirm they see what I see? Anyone have a similar experience? BugZilla (http://bugzilla.mozilla.org/) is rather difficult for me to use, so I haven't been able to use it well enough to find reports of this. Tested Browsers: Mozilla 1.5 Gecko/20030916 FireBird 0.7 Gecko/20031007 Netscape 7.1 Gecko/20030624
RE: Validator JavaScript displaying? Mozilla bug?
Brad, I am using Mozilla 0.7 and I saw what you described the first time I went to your page. I can't get it to repeat however. Then I tried for kicks on another machine and didn't see it at all. On that other machine I am just getting validator set up on a project and I tried it, and it looked fine each time in Mozilla. I did notice that I put the tags for the javascript outside the body tags but inside the html tags,whereas your are in the middle of the page. Maybe the first time it loads, since it hasn't loaded the entire page, it gets confused and displays the javascript but on subsequent loads, it is probably coming from cache and has the entire html and so renders it correctly? A little far-fetched maybe. I would try moving your javascript tag outside of the body tags and see what kind of result you get. -Rob Rob Nocera www.neosllc.com -Original Message- From: Brad Plies [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 10:32 AM To: [EMAIL PROTECTED] Subject: Validator JavaScript displaying? Mozilla bug? Hi folks, I am having a problem with Mozilla, Netscape, and FireBird browsers on pages that use the validator JavaScript. It seems that the browsers choke on all that script and end up displaying the script instead of the page content ( even though the script is guarded by the HTML comments) about 80% of the time. Please see: http://www.bulliondirect.com/catalog/showProducts.do?category=1 When I have a garbled page, I look at the page source, and the source looks fine. The page validates as HTML 4.01 Transitional compliant via: http://validator.w3.org/file-upload.html http://validator.w3.org/detailed.html The only way I can get it to display correctly, is to keep hitting reload until it renders correctly, but the page source is always the same by file comparison. If you File-Save a garbled page, and load it from file, it renders correctly. IE does not have this problem, and I cannot find any evidence that any one else has ever experienced this either. What makes our pages a special case? I know all the affected browsers are related in some way, do they share some sort of common bug (In Gecko I presume)? Can anyone confirm they see what I see? Anyone have a similar experience? BugZilla (http://bugzilla.mozilla.org/) is rather difficult for me to use, so I haven't been able to use it well enough to find reports of this. Tested Browsers: Mozilla 1.5 Gecko/20030916 FireBird 0.7 Gecko/20031007 Netscape 7.1 Gecko/20030624 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying same page after submiting a form
I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_save_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_save.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_save_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save_ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :)
RE: Displaying same page after submiting a form
I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying same page after submiting a form
That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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: Displaying same page after submiting a form
Hmmm..strange...can you send a screen shot of how the page looks before and after the submit. -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:41 AM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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: Displaying same page after submiting a form
Showing your JSP directly results in missing images because the relative path to your images have changed. Try using absolute path to your images. If you want to avoid using the absolute path to your images, make sure that the browser requests your JSP in a way that the relative paths to the images are still valid. Or, you could try using a ForwardAction. --- Shishir K. Singh [EMAIL PROTECTED] wrote: Hmmm..strange...can you send a screen shot of how the page looks before and after the submit. -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:41 AM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying same page after submiting a form
Also, Try using html:base/ Within the head section of your jsp. See if that works. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 12:12 PM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form Showing your JSP directly results in missing images because the relative path to your images have changed. Try using absolute path to your images. If you want to avoid using the absolute path to your images, make sure that the browser requests your JSP in a way that the relative paths to the images are still valid. Or, you could try using a ForwardAction. --- Shishir K. Singh [EMAIL PROTECTED] wrote: Hmmm..strange...can you send a screen shot of how the page looks before and after the submit. -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:41 AM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_ sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_s av e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_ sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_sa ve _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe
RE: Displaying same page after submiting a form
Hiya, Find attached before and after screen shots... regards -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 17:00 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form Hmmm..strange...can you send a screen shot of how the page looks before and after the submit. -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:41 AM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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]
FW: Displaying same page after submiting a form
That works :) Interesting... thanks so much! -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 17:27 To: [EMAIL PROTECTED] Subject: RE: Displaying same page after submiting a form Don't think I got any. However, try out the html:base/ And see if you still get the errors. If yes, send in the source (that you can view from the browser when the page is displayed). Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 12:22 PM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form Hiya, Find attached before and after screen shots... regards -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 17:00 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form Hmmm..strange...can you send a screen shot of how the page looks before and after the submit. -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:41 AM To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form That's what i did initially, but it caused the page to be displayed with errors (images missing, etc) even though the forwar path was exactly the same as the parameter path... i.e. parameter=/pages/disco/config_toolbar.jsp forward name =success path=/pages/disco/config_toolbar.jsp thanks -Original Message- From: Shishir K. Singh [mailto:[EMAIL PROTECTED] Sent: 12 January 2004 16:31 To: Struts Users Mailing List Subject: RE: Displaying same page after submiting a form I think you need to add the forward to your action definition action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session forwardname=success path=your jsp/ forwardname=failure path=your jsp /action In your action, when your forward to success or failure, your will be brought to the specific jsp that you want (in your case the same ) Shishir -Original Message- From: Leticia Golubov [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 11:25 AM To: Struts User Mailing List Subject: Displaying same page after submiting a form I'm using the following code to submit an action in a .jsp file (config_toolbar.jsp): html:form method=post action=/saveData name=saveForm type=text/html type=org.apache.struts.action.DynaActionForm enctype=text/html tda onClick=javascript:void(document.saveForm.submit()); onMouseOver=javascript:SwapImage('save','../../images/button_toolbar_sa ve_o ver.png'); SetStatus('Save Configuration'); return true; onMouseOut=javascript:SwapImage('save','../../images/button_toolbar_sav e.pn g'); SetStatus(''); return true; onMouseDown=javascript:SwapImage('save','../../images/button_toolbar_sa ve_c lick.png'); onMouseUp=javascript:SwapImage('save','../../images/button_toolbar_save _ove r.png'); img name=save src=../../images/button_toolbar_save.png border=0 width=26 height=26 alt=Save Configuration/a/td /html:form The action is found/executed, and, as a default I'm returning a findforward(success) at the end of the ActionForward method in my SaveAction.java class. in struts_config.xml I have the following defined: action path=/saveData type=com.micromuse.precision.disco.action.SaveAction name=saveDataForm parameter=/pages/disco/config_toolbar.jsp scope=session /action In the hope that config_toolbar.jsp will still be displayed instead of the blank page I get after I do a mouseClick on the button_toolbar_save.png image. I've tried setting the forward name to the config_toolbar.jsp, but that caused strange side effect (all images were missing, the page didn't display properly). So, essentiall, I want the same page to be displayed after the saveData action is executed. Does anyone know how to do this? p.s. I'm new to struts, so could (and I hope it is) be something very simple. regards Leticia :) - 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]
Problem displaying ActionMessages in JSP
Hello Can anybody help me? I am trying to display messages on my JSP based on whether an insertion to the DB was successful or not. Properties file: dbsuccess.add = Database Success: Details Added dberror.add = Database Error: Unable To Add Details At This Time Action Class: /* create ActionErrors instance to hold success/failure messages */ ActionMessages messages = new ActionMessages(); try { ..business logic messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dbsuccess.add)); setSession(messages, request); } catch (Exception e) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dberror.add)); setSession(messages, request); } private void setSession(ActionMessages messages, HttpServletRequest request) { /* put the messages in the session */ request.getSession().getServletContext().setAttribute(messages, messages); } JSP file: logic:messagesPresent message=true font color=redUL html:messages id=messages LI bean:write name=messages / /LI /html:messages /UL/fonthr /logic:messagesPresent Nothing is being printed at the top of the page, the insertion into the database works fine but I cant get the success message up. Does anybody know why this is happening? Thanks, Ciaran
Re: Problem displaying ActionMessages in JSP
try calling saveMessages(request,messages) in your action class. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Hello Can anybody help me? I am trying to display messages on my JSP based on whether an insertion to the DB was successful or not. Properties file: dbsuccess.add = Database Success: Details Added dberror.add = Database Error: Unable To Add Details At This Time Action Class: /* create ActionErrors instance to hold success/failure messages */ ActionMessages messages = new ActionMessages(); try { ..business logic messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dbsuccess.add)); setSession(messages, request); } catch (Exception e) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dberror.add)); setSession(messages, request); } private void setSession(ActionMessages messages, HttpServletRequest request) { /* put the messages in the session */ request.getSession().getServletContext().setAttribute(messages, messages); } JSP file: logic:messagesPresent message=true font color=redUL html:messages id=messages LI bean:write name=messages / /LI /html:messages /UL/fonthr /logic:messagesPresent Nothing is being printed at the top of the page, the insertion into the database works fine but I cant get the success message up. Does anybody know why this is happening? Thanks, Ciaran __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem displaying ActionMessages in JSP
Thanks Hubert, That has me going in the right direction, however only the hr element is printing at the top of the page now. The message elements aren't getting printed as they should. Can anybody spot the problem, I cant Thanks, Ciaran -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 16:56 To: Struts Users Mailing List Subject: Re: Problem displaying ActionMessages in JSP try calling saveMessages(request,messages) in your action class. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Hello Can anybody help me? I am trying to display messages on my JSP based on whether an insertion to the DB was successful or not. Properties file: dbsuccess.add = Database Success: Details Added dberror.add = Database Error: Unable To Add Details At This Time Action Class: /* create ActionErrors instance to hold success/failure messages */ ActionMessages messages = new ActionMessages(); try { ..business logic messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dbsuccess.add)); setSession(messages, request); } catch (Exception e) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dberror.add)); setSession(messages, request); } private void setSession(ActionMessages messages, HttpServletRequest request) { /* put the messages in the session */ request.getSession().getServletContext().setAttribute(messages, messages); } JSP file: logic:messagesPresent message=true font color=redUL html:messages id=messages LI bean:write name=messages / /LI /html:messages /UL/fonthr /logic:messagesPresent Nothing is being printed at the top of the page, the insertion into the database works fine but I cant get the success message up. Does anybody know why this is happening? Thanks, Ciaran __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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: Problem displaying ActionMessages in JSP
also, add message=true to your html:messages: html:messages id=messages message=true bean:write name=messages/br /html:messages While your at it, you can use id=message and name=message because AFAIK, that identifier will be used to refer to a single message. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Thanks Hubert, That has me going in the right direction, however only the hr element is printing at the top of the page now. The message elements aren't getting printed as they should. Can anybody spot the problem, I cant Thanks, Ciaran -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 16:56 To: Struts Users Mailing List Subject: Re: Problem displaying ActionMessages in JSP try calling saveMessages(request,messages) in your action class. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Hello Can anybody help me? I am trying to display messages on my JSP based on whether an insertion to the DB was successful or not. Properties file: dbsuccess.add = Database Success: Details Added dberror.add = Database Error: Unable To Add Details At This Time Action Class: /* create ActionErrors instance to hold success/failure messages */ ActionMessages messages = new ActionMessages(); try { ..business logic messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dbsuccess.add)); setSession(messages, request); } catch (Exception e) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dberror.add)); setSession(messages, request); } private void setSession(ActionMessages messages, HttpServletRequest request) { /* put the messages in the session */ request.getSession().getServletContext().setAttribute(messages, messages); } JSP file: logic:messagesPresent message=true font color=redUL html:messages id=messages LI bean:write name=messages / /LI /html:messages /UL/fonthr /logic:messagesPresent Nothing is being printed at the top of the page, the insertion into the database works fine but I cant get the success message up. Does anybody know why this is happening? Thanks, Ciaran __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem displaying ActionMessages in JSP
I already had the message=true part in the JSP code. I changed the id and name value to message as you said but I get the same result, just the hr is produced Ciaran -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 17:16 To: Struts Users Mailing List Subject: RE: Problem displaying ActionMessages in JSP also, add message=true to your html:messages: html:messages id=messages message=true bean:write name=messages/br /html:messages While your at it, you can use id=message and name=message because AFAIK, that identifier will be used to refer to a single message. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Thanks Hubert, That has me going in the right direction, however only the hr element is printing at the top of the page now. The message elements aren't getting printed as they should. Can anybody spot the problem, I cant Thanks, Ciaran -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 16:56 To: Struts Users Mailing List Subject: Re: Problem displaying ActionMessages in JSP try calling saveMessages(request,messages) in your action class. --- Ciaran Hanley [EMAIL PROTECTED] wrote: Hello Can anybody help me? I am trying to display messages on my JSP based on whether an insertion to the DB was successful or not. Properties file: dbsuccess.add = Database Success: Details Added dberror.add = Database Error: Unable To Add Details At This Time Action Class: /* create ActionErrors instance to hold success/failure messages */ ActionMessages messages = new ActionMessages(); try { ..business logic messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dbsuccess.add)); setSession(messages, request); } catch (Exception e) { messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(dberror.add)); setSession(messages, request); } private void setSession(ActionMessages messages, HttpServletRequest request) { /* put the messages in the session */ request.getSession().getServletContext().setAttribute(messages, messages); } JSP file: logic:messagesPresent message=true font color=redUL html:messages id=messages LI bean:write name=messages / /LI /html:messages /UL/fonthr /logic:messagesPresent Nothing is being printed at the top of the page, the insertion into the database works fine but I cant get the success message up. Does anybody know why this is happening? Thanks, Ciaran __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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: Displaying messages as a result of failure
Hi, Here is an article from IBM which takes you step by step through some of the basic struts. I admit not the best article I have read, but step 6 has the basics of what you are looking for. http://www-106.ibm.com/developerworks/websphere/techjournal/0302_fung/fung.html I recommend picking up any of the excellent Struts books out there from O'Reilly or Manning. Tin bort [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all How do I present, to the user, customized messages in the case of an Action failure? For example, say a user fills and submits a form. The form gets validated, and control is passed onto the Action. From within the action, we have a success and failure forward. In the case of a failure, I forward the user back to the same page. What I'd like to do now, however, is to print out a customized message on this page, explaining what the problem was. I realize that this is a rather simple question... so please go easy on me! TIA bort - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying messages as a result of failure
step 1) in your action's execute method ActionErrors errors = new ActionErrors(); errors.add(userHasFooProblem,new ActionError(message.key)); //message.key must be in resource bundle, e.g., application.properties this.saveErrors(errors); return mapping.findForward(failure); step 2) then in your jsp.. html:messages property=userHasForProblems / (I did this off the top of my head so if the syntax is wrong opps... it should be close). Rick Hightower Developer Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm Struts/J2EE consulting -- http://www.arc-mind.com/consulting.htm#StrutsMentoring -Original Message- From: bort [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: Displaying messages as a result of failure Hi all How do I present, to the user, customized messages in the case of an Action failure? For example, say a user fills and submits a form. The form gets validated, and control is passed onto the Action. From within the action, we have a success and failure forward. In the case of a failure, I forward the user back to the same page. What I'd like to do now, however, is to print out a customized message on this page, explaining what the problem was. I realize that this is a rather simple question... so please go easy on me! TIA bort - 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: Displaying messages as a result of failure
Thanks Richard! Richard Hightower [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] step 1) in your action's execute method ActionErrors errors = new ActionErrors(); errors.add(userHasFooProblem,new ActionError(message.key)); //message.key must be in resource bundle, e.g., application.properties this.saveErrors(errors); return mapping.findForward(failure); step 2) then in your jsp.. html:messages property=userHasForProblems / (I did this off the top of my head so if the syntax is wrong opps... it should be close). Rick Hightower Developer Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm Struts/J2EE consulting -- http://www.arc-mind.com/consulting.htm#StrutsMentoring -Original Message- From: bort [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 11:48 AM To: [EMAIL PROTECTED] Subject: Displaying messages as a result of failure Hi all How do I present, to the user, customized messages in the case of an Action failure? For example, say a user fills and submits a form. The form gets validated, and control is passed onto the Action. From within the action, we have a success and failure forward. In the case of a failure, I forward the user back to the same page. What I'd like to do now, however, is to print out a customized message on this page, explaining what the problem was. I realize that this is a rather simple question... so please go easy on me! TIA bort - 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]
Displaying messages as a result of failure
Hi all How do I present, to the user, customized messages in the case of an Action failure? For example, say a user fills and submits a form. The form gets validated, and control is passed onto the Action. From within the action, we have a success and failure forward. In the case of a failure, I forward the user back to the same page. What I'd like to do now, however, is to print out a customized message on this page, explaining what the problem was. I realize that this is a rather simple question... so please go easy on me! TIA bort - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in displaying ValueObject contents using logic tag
yoyu have to specify the class name of the value object in the type attribute of the iterate tag. this will solve the problem - Original Message - From: Sudhakar G [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 02, 2004 12:13 PM Subject: Problem in displaying ValueObject contents using logic tag Hi All, My ArrayList holds a set of ValueObjects.When I try to display the ArrayList contents using logic tag it is throwing an exception saying can't find the clientview bean. In Action class the code is like. request.setAttribute(ClientList,clientListVO); return mapping.findForward(success); In Jsp logic:iterate name=ClientList id=clientview bean:write name=clientview property=clientID/ /logic:iterate Value Object has ClientID as attribute with get and set methods. Can any one help in this problem that will be thankful.. Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services on any subject matter. Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services shall be understood as neither given nor endorsed by Tata Consultancy Services or any affiliate of Tata Consultancy Services. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem in displaying ValueObject contents using logic tag
Hi All, My ArrayList holds a set of ValueObjects.When I try to display the ArrayList contents using logic tag it is throwing an exception saying can't find the clientview bean. In Action class the code is like. request.setAttribute(ClientList,clientListVO); return mapping.findForward(success); In Jsp logic:iterate name=ClientList id=clientview bean:write name=clientview property=clientID/ /logic:iterate Value Object has ClientID as attribute with get and set methods. Can any one help in this problem that will be thankful.. Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem in Displaying ArrayList constents in jsp
Hi All, My ArrayList holds a set of ValueObjects.When I try to display the ArrayList contents using logic tag it is throwing an exception saying can't find the clientview bean. In Action class the code is like. request.setAttribute(ClientList,clientListVO); return mapping.findForward(success); In Jsp logic:iterate name=ClientList id=clientview bean:write name=clientview property=clientID/ /logic:iterate Value Object has ClientID as attribute with get and set methods. Can any one help in this problem that will be thankful.. Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem in Displaying ArrayList constents in jsp
Are you redirecting instead of forwarding? If so, your request attributes will be lost once the page is rendered. robert -Original Message- From: Sudhakar G [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 12:05 AM To: [EMAIL PROTECTED] Subject: Problem in Displaying ArrayList constents in jsp Hi All, My ArrayList holds a set of ValueObjects.When I try to display the ArrayList contents using logic tag it is throwing an exception saying can't find the clientview bean. In Action class the code is like. request.setAttribute(ClientList,clientListVO); return mapping.findForward(success); In Jsp logic:iterate name=ClientList id=clientview bean:write name=clientview property=clientID/ /logic:iterate Value Object has ClientID as attribute with get and set methods. Can any one help in this problem that will be thankful.. Thanks in advance.. cheers Sudhakar DISCLAIMER: This message (including attachment if any) is confidential and may be privileged. Before opening attachments please check them for viruses and defects. MindTree Consulting Private Limited (MindTree) will not be responsible for any viruses or defects or any forwarded attachments emanating either from within MindTree or outside. If you have received this message by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission. - 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]
displaying errors
This is more out of curiosity than a need, but does anyone have a way of drilling to ActionMessages previously ActionsErrors in jstl. My understanding is that html:errors is deprecated but that silly messagesPresent stuff does my suede in. If been trying c:out value=${actionMessages.myproperty} / But to no avail. I was/am happy using html:errors but with everyone spanking their monkeys so hard over jstl I assumed that html:errors was up for deprecation with good reason.. Cheers Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
messages tag not displaying messages
The messages tag supposed to display all the messages automatically ? When I place this on the JSP, the messages do not display: [EMAIL PROTECTED] prefix=html uri=/struts-html% html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ I know that the message key is correct, the message resource file can be found, and the messages collection has been properly placed in the request, etc. etc. because if I add (below that line) this tag: bean:write name=resultMsg/ to the page, then the message does display. But I shouldn't have to do that, right ? Since adding the bean:write tag does display a message from the collection, this does not appear to be a basic setup issue. It's more a question about the intended behavior of the messages tag. Why doesn't this usage of the messages tag html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ automatically display all messages in the collection ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: messages tag not displaying messages
Frank, I believe you want to use the bean:messages ./ tag. There isn't an html:messages tag. -Richard At 06:18 PM 12/5/2003, you wrote: The messages tag supposed to display all the messages automatically ? When I place this on the JSP, the messages do not display: [EMAIL PROTECTED] prefix=html uri=/struts-html% html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ I know that the message key is correct, the message resource file can be found, and the messages collection has been properly placed in the request, etc. etc. because if I add (below that line) this tag: bean:write name=resultMsg/ to the page, then the message does display. But I shouldn't have to do that, right ? Since adding the bean:write tag does display a message from the collection, this does not appear to be a basic setup issue. It's more a question about the intended behavior of the messages tag. Why doesn't this usage of the messages tag html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ automatically display all messages in the collection ? - 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: messages tag not displaying messages
Frank, Please disregard the last message. I wasn't paying attention and was looking at the Struts 1.0 docs instead of Struts 1.1. If you are using ActionMessages, then in your action, you'd have something like this: ActionMessages messages = new ActionMessages(); ActionMessage msg = new ActionMessage(data.ok); messages.add(message1, msg); msg = new ActionMessage(data.continue); messages.add(message2, msg); saveMessages(request, messages); and in your JSP, to print out all of the messages, you would use this: html:messages id=msg message=true bean:write name=msg/br /html:messages The id param sets up the bean for the bean:write The message param = true indicates that the bean will be obtained using Globals.MESSAGE_KEY instead of Globals.ERROR_KEY To find out more, check out this article: http://javaboutique.internet.com/tutorials/excep_struts/index-2.html Regards, Richard At 06:18 PM 12/5/2003, you wrote: The messages tag supposed to display all the messages automatically ? When I place this on the JSP, the messages do not display: [EMAIL PROTECTED] prefix=html uri=/struts-html% html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ I know that the message key is correct, the message resource file can be found, and the messages collection has been properly placed in the request, etc. etc. because if I add (below that line) this tag: bean:write name=resultMsg/ to the page, then the message does display. But I shouldn't have to do that, right ? Since adding the bean:write tag does display a message from the collection, this does not appear to be a basic setup issue. It's more a question about the intended behavior of the messages tag. Why doesn't this usage of the messages tag html:messages id=resultMsg name=ATTR_ACTION_MESSAGES/ automatically display all messages in the collection ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying status messages on the browser while action is executed...
Hi, I need to display a progressing status message during the time it takes to execute an action, after a button click, and return to the form with the appropriate data. So essentially it involves displaying a status message in the browser as soon as the button is clicked. The message continues to be displayed till the form is loaded afresh. Could somebody please help me with that? Thanks and regards, Shubha.
RE: Displaying status messages on the browser while action is executed...
I used a simple trick to achieve this in an app I was working on, where the submission went through a JavaScript method that would end by calling form.submit(). Just before doing this it would change the css style on a hidden section of the page to reveal the please wait message. It would also hide the section containing the form contents and the submit button. This gives quite nice feedback to the user making the app feel more responsive, as the screen changes on the instance they click the button (even though the next page doesnt come up for a couple of seconds). There are of course several drawbacks to this method: * It needs JavaScript (and has potential compatibility issues with older browsers) * If the user clicks stop the message remains there - they will have to reload the page to be able to use it again. -Original Message- From: Shubha [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 November 2003 18:01 To: Struts Users Digest Mailing List Subject: Displaying status messages on the browser while action is executed... Hi, I need to display a progressing status message during the time it takes to execute an action, after a button click, and return to the form with the appropriate data. So essentially it involves displaying a status message in the browser as soon as the button is clicked. The message continues to be displayed till the form is loaded afresh. Could somebody please help me with that? Thanks and regards, Shubha. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying a dialogue box with Struts...
Hi!! How to display a dialog box using struts. The dialog box will contain two button (Ok and Cancel). Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying a dialogue box with Struts... [OT]
This is not really Struts related... You can do it with JavaScript (IE only) var result = showModalDialog( 'dialog.jsp','','dialogHeight:10;status:no;'); And in the 'dialog.jsp' use the returnValue: input type=button value=Ok onClick=self.returnValue='Ok'; self.close(); input type=button value=Cancel onClick=self.returnValue='Cancel'; self.close(); I think there is not other way with javascript (all the things I tried were easily bypassed by the usr)... May be a 'server' based solution with Java, to be sure that the user has choosed an option? Regards. Zakaria khabot wrote: Hi!! How to display a dialog box using struts. The dialog box will contain two button (Ok and Cancel). Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Class not displaying
I just downloaded v1.1 and have things working. some-what. I have two simple action mappings that redirect to a jspthese are working. I'm trying to create an action mapping that refers to a action class and sends the user to the specified jsp. Currently there is no logic in the action class, right now I just want to map out the flow of the site and then add content later. When I test the link from the web page all that is returned is a blank page. the System.out.println()'s aren't writing anything to the console either. This is the action class in question and the reference from the struts-config.xml file public final class MessageAction extends Action implements ActionConstants { public ActionForward execute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception { System.out.println(here 1); ActionErrors errors = new ActionErrors(); // do something // forward control to the specified success URI System.out.println(here 2); return(mapping.findForward(READ_MESSAGE)); } } action path=/ReadMessage type=com.dynamichostings.mailclient.servlet.MessageAction forward name=read_message path=/message/read_message.jsp / /action any suggestions?
RE: Action Class not displaying
1) What do you mean by test the link from the web page? Does that mean you have a a href=blah.do somewhere on the page? If so what does that link look like and how did you create it. 2) What does your web.xml look like? -Tim -Original Message- From: David Liles [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2003 1:31 PM To: [EMAIL PROTECTED] Subject: Action Class not displaying I just downloaded v1.1 and have things working. some-what. I have two simple action mappings that redirect to a jspthese are working. I'm trying to create an action mapping that refers to a action class and sends the user to the specified jsp. Currently there is no logic in the action class, right now I just want to map out the flow of the site and then add content later. When I test the link from the web page all that is returned is a blank page. the System.out.println()'s aren't writing anything to the console either. This is the action class in question and the reference from the struts-config.xml file public final class MessageAction extends Action implements ActionConstants { public ActionForward execute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception { System.out.println(here 1); ActionErrors errors = new ActionErrors(); // do something // forward control to the specified success URI System.out.println(here 2); return(mapping.findForward(READ_MESSAGE)); } } action path=/ReadMessage type=com.dynamichostings.mailclient.servlet.MessageAction forward name=read_message path=/message/read_message.jsp / /action any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Action Class not displaying
Thanks for replying Tim... I have two links I'm trying to get work... see bleow: link 1 - a href=javascript:readMessage();test link 1/a link 2 - html:link page=/ReadMessage.dotest link 2/html:link link 1 makes a call that creates a popup window that will ultimately display the results from the action class. both links display a blank page the action class has a couple system.out that never execute... this is the web.xml file... ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping taglib taglib-uri/tags/struts-bean/taglib-uri taglib-location/WEB-INF/tld/struts-bean.tld/taglib-location /taglib taglib taglib-uri/tags/struts-html/taglib-uri taglib-location/WEB-INF/tld/struts-html.tld/taglib-location /taglib taglib taglib-uri/tags/struts-logic/taglib-uri taglib-location/WEB-INF/tld/struts-logic.tld/taglib-location /taglib /web-app -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Fri 10/24/2003 3:31 PM To: 'Struts Users Mailing List' Cc: Subject: RE: Action Class not displaying 1) What do you mean by test the link from the web page? Does that mean you have a a href=blah.do somewhere on the page? If so what does that link look like and how did you create it. 2) What does your web.xml look like? -Tim -Original Message- From: David Liles [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2003 1:31 PM To: [EMAIL PROTECTED] Subject: Action Class not displaying I just downloaded v1.1 and have things working. some-what. I have two simple action mappings that redirect to a jspthese are working. I'm trying to create an action mapping that refers to a action class and sends the user to the specified jsp. Currently there is no logic in the action class, right now I just want to map out the flow of the site and then add content later. When I test the link from the web page all that is returned is a blank page. the System.out.println()'s aren't writing anything to the console either. This is the action class in question and the reference from the struts-config.xml file public final class MessageAction extends Action implements ActionConstants { public ActionForward execute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception { System.out.println(here 1); ActionErrors errors = new ActionErrors(); // do something // forward control to the specified success URI System.out.println(here 2); return(mapping.findForward(READ_MESSAGE)); } } action path=/ReadMessage type=com.dynamichostings.mailclient.servlet.MessageAction forward name=read_message path=/message/read_message.jsp / /action any suggestions? - 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]
What are the best practices for displaying Errors and Messages
Hi, Can anyone detail the best practices to display ActionErrors and ActionMessages in JSP? Thanks in Advance. Ravi Kulkarni. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: All page tiles are not displaying properly
I don't know if you are sure about what you're doing, but I don't understand why you don't just simply: put name=body value=jsp/body.jsp/ Caroline - Original Message - From: Appel, Jeremy D [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 8:35 PM Subject: All page tiles are not displaying properly I am using Tiles and I am running into a problem that I can not seem to explain. I have all my tiles definitions in the requisite def files etc. I am using the classicLayout tile and all tile values are links to forward actions: put name=body value=/body.do/ with the corresponding action: action path=/body type=org.apache.struts.actions.ForwardAction parameter=/jsp/body.jsp/. For some reason, when accessing actions that reference definitions that display a new page, one of the tiles that comprises the page will not be displayed initially. In order for the entire page to be displayed, I need to hit the refresh button. Can anyone explain this behavior? TIA Jeremy - 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: All page tiles are not displaying properly
I am trying to using only ForwardActions to link to pages within my site. Also by using only ForwardActions in my tiles defs, I can use a security-constraint on my jsp directory to ensure that no one accesses them directly. -Original Message- From: Caroline Lauferon [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 9:05 AM To: Struts Users Mailing List Subject: Re: All page tiles are not displaying properly I don't know if you are sure about what you're doing, but I don't understand why you don't just simply: put name=body value=jsp/body.jsp/ Caroline - Original Message - From: Appel, Jeremy D [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 8:35 PM Subject: All page tiles are not displaying properly I am using Tiles and I am running into a problem that I can not seem to explain. I have all my tiles definitions in the requisite def files etc. I am using the classicLayout tile and all tile values are links to forward actions: put name=body value=/body.do/ with the corresponding action: action path=/body type=org.apache.struts.actions.ForwardAction parameter=/jsp/body.jsp/. For some reason, when accessing actions that reference definitions that display a new page, one of the tiles that comprises the page will not be displayed initially. In order for the entire page to be displayed, I need to hit the refresh button. Can anyone explain this behavior? TIA Jeremy - 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]
All page tiles are not displaying properly
I am using Tiles and I am running into a problem that I can not seem to explain. I have all my tiles definitions in the requisite def files etc. I am using the classicLayout tile and all tile values are links to forward actions: put name=body value=/body.do/ with the corresponding action: action path=/body type=org.apache.struts.actions.ForwardAction parameter=/jsp/body.jsp/. For some reason, when accessing actions that reference definitions that display a new page, one of the tiles that comprises the page will not be displayed initially. In order for the entire page to be displayed, I need to hit the refresh button. Can anyone explain this behavior? TIA Jeremy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying Errors in JSP !!
Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu.
Re: Displaying Errors in JSP !!
Hi There, Please have a look at html:errors tag posting earlier today.. There are couple of responses th that thread. They will help you. Ritvik Dhanunjaya Gotur wrote: Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying Errors in JSP !!
Hi Rthvik, Thanx ..and is it possible to do the same thing with validator.xml Cheer's Dhanu. - Original Message - From: Ritvik [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 9:20 PM Subject: Re: Displaying Errors in JSP !! Hi There, Please have a look at html:errors tag posting earlier today.. There are couple of responses th that thread. They will help you. Ritvik Dhanunjaya Gotur wrote: Hi, I am new to Struts and I am using Struts1.1 and my question is How to display an Error Message in my Login JSP (Which is having two fields 1. Login ID 2. Password) So When User enters LoginID and incorrect password ., I should display a message in my JSP something like The password you entered is invalid. Please try again... So pl. send me all possible solutions.. Cheer's Dhanu. - 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]
struts tags displaying in html
Hi I know I have seen this on the list before but all the search phrases I try don't seem to find what I am looking for. I am having the problem that custom tags (such as struts-html and my own custom tags) are not getting converting when the jsp pages goes through the compiler and the html that I view through the browser still have the custom tags. Cheers Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts tags displaying in html
The last time i faced this kind of problem is when i forget to include/import taglib definition in my jsps's, for example: %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % But, CMIIW. bdR. -Original Message- From: Peter Abbot [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2003 1:05 PM To: [EMAIL PROTECTED] Subject: struts tags displaying in html Hi I know I have seen this on the list before but all the search phrases I try don't seem to find what I am looking for. I am having the problem that custom tags (such as struts-html and my own custom tags) are not getting converting when the jsp pages goes through the compiler and the html that I view through the browser still have the custom tags. Cheers Pete - 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: displaying collections after a validate() error
Graham, I'm guessing you have an action which prepares this page for display by populating the collection and placing it in the request scope and forwarding to the JSP page where it is rendered successfully the first time. Upon, a validation error, you have configured in your struts-config file the input to be the JSP page. When a validation error occurs, the page is displayed, but since the collection was in the request scope, it has long been discarded and thus is not displayed. There are a couple work arounds for this problem: 1. Set the input attribute of the action which processes the form submit, to the action which prepares the page for display. When a validation error occurs the request will be forward to your 'prepare' action which will populate the collection and forward to the JSP page where the collection will be rendered and the appropriate error messages will be displayed. 2. Populate your collection in the form.reset() HTH, robert -Original Message- From: Graham Stark [mailto:[EMAIL PROTECTED] Sent: Sunday, August 31, 2003 5:12 PM To: Struts Users Mailing List Subject: displaying collections after a validate() error Hi, could someone suggest what I'm doing wrong here? I've got a form with an associated ActionForm, several members of which are collections. I display them like this: logic:iterate property=domainRoles name=myForm id=domain tr class=dataTableHeader td align=leftc:out value=${domain.roleDescription}//td [] Whilst single valued fields are displayed like: html:textarea property=notes cols=15 All seems well, and everything displays fine. However, the ActionForm has a validate() method, which send the user back at the form, which displays some error messages. When this happens, however, the JSP doesn't display the collections from the ActionForm, only single valued fields. Can anyone suggest what I'm doing wrong here? thanks, Graham -- Graham Stark, Virtual Worlds phone: (+044) 01908 618239 mobile: 07952 633185 Homepage http://www.virtual-worlds.biz Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla Virtual Economy http://www.bized.ac.uk/virtual/economy - 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]
displaying collections after a validate() error
Hi, could someone suggest what I'm doing wrong here? I've got a form with an associated ActionForm, several members of which are collections. I display them like this: logic:iterate property=domainRoles name=myForm id=domain tr class=dataTableHeader td align=leftc:out value=${domain.roleDescription}//td [] Whilst single valued fields are displayed like: html:textarea property=notes cols=15 All seems well, and everything displays fine. However, the ActionForm has a validate() method, which send the user back at the form, which displays some error messages. When this happens, however, the JSP doesn't display the collections from the ActionForm, only single valued fields. Can anyone suggest what I'm doing wrong here? thanks, Graham -- Graham Stark, Virtual Worlds phone: (+044) 01908 618239 mobile: 07952 633185 Homepage http://www.virtual-worlds.biz Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla Virtual Economy http://www.bized.ac.uk/virtual/economy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP not displaying data when in Edit Mode
My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction Remove this attribute attribute=testForm and replace with name=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings 'name' is the name of the form bean that is created and given to the action form. -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP not displaying data when in Edit Mode
Thanks for the response Jason. I tried this. But didn't work. Same result. Any other ideas? I can email you all files associated with this pipeline if you prefer. Thanks again. [EMAIL PROTECTED] 08/27/03 03:49PM My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction Remove this attribute attribute=testForm and replace with name=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings 'name' is the name of the form bean that is created and given to the action form. -- Jason Lea - 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: JSP not displaying data when in Edit Mode
I have resolved this issue. But can not explain how it is fixed. :-) Can any of the struts gurus out there shed some light on why this is so? My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action By replacing following line action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm with action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm scope=request /action /action-mappings I was able to get my TestForm.jsp display data and get it into edit mode. Though I am only trying to access http://localhost/myapp/testPage.do, I am not sure why NOT HAVING SCOPE in /saveTestPage action made it not to display data given in TestForm. Any ideas? [EMAIL PROTECTED] 08/27/03 02:13PM All, I am trying to get my JSP to display data from my form when in Edit mode. I am new to Struts and using Struts 1.1 I am not sure what I am doing wrong. Any help or pointers at resources would be appreciated. I have included my struts-config, my jsp, my action class and my form class. When I load my jsp, I am expecting to see Filed1 value from action in field1 as defined in the action class. However, I am seeing the default Test Field1 as defined in the ActionForm class. One thing I noticed is, my form is null in action execute class and I see 'Test Form is null. Creating new one... in the console. Any idea what I am doing wrong? TIA - Srinivas My JSP: [EMAIL PROTECTED] language=java import=mybean.*% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:form action=saveTestPage Field 1 : html:text property=field1 size=15/br / Field 2 : html:text property=field2 size=15/ br / html:submitSubmit/html:submit /html:form My Form: private String field1; private String field2; public void reset(ActionMapping arg0, HttpServletRequest arg1) { field1 = Test Field1; field2 = Test Field2; } public String getField1() { return field1; } public String getField2() { return field2; } public void setField1(String field1) { this.field1 = field1; } public void setField2(String field2) { this.field2 = field2; } My Action: public ActionForward execute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) { HttpSession session = aRequest.getSession(); if ( aForm == null ) { System.out.println(Test Form is null. Creating new one...); aForm = new TestForm(); } TestForm testForm = (TestForm) aForm; testForm.setField1(Filed1 value from action); testForm.setField2(Field2 value from action); if (request.equals(aMapping.getScope())) { aRequest.setAttribute(aMapping.getAttribute(), testForm); } else { session.setAttribute(aMapping.getAttribute(), testForm); } return aMapping.findForward(Constants.SUCCESS); } My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings - 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: JSP not displaying data when in Edit Mode
What you cut and pasted suggested a typo of a missing closing slash before the end of the action tag: action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm Should've been either: action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm/ OR action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm !-- something could go here, forwards, set paramters, etc -- /actino Regards, David -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 10:05 AM To: [EMAIL PROTECTED] Subject: Re: JSP not displaying data when in Edit Mode I have resolved this issue. But can not explain how it is fixed. :-) Can any of the struts gurus out there shed some light on why this is so? My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action By replacing following line action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm with action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm scope=request /action /action-mappings I was able to get my TestForm.jsp display data and get it into edit mode. Though I am only trying to access http://localhost/myapp/testPage.do, I am not sure why NOT HAVING SCOPE in /saveTestPage action made it not to display data given in TestForm. Any ideas? [EMAIL PROTECTED] 08/27/03 02:13PM All, I am trying to get my JSP to display data from my form when in Edit mode. I am new to Struts and using Struts 1.1 I am not sure what I am doing wrong. Any help or pointers at resources would be appreciated. I have included my struts-config, my jsp, my action class and my form class. When I load my jsp, I am expecting to see Filed1 value from action in field1 as defined in the action class. However, I am seeing the default Test Field1 as defined in the ActionForm class. One thing I noticed is, my form is null in action execute class and I see 'Test Form is null. Creating new one... in the console. Any idea what I am doing wrong? TIA - Srinivas My JSP: [EMAIL PROTECTED] language=java import=mybean.*% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:form action=saveTestPage Field 1 : html:text property=field1 size=15/br / Field 2 : html:text property=field2 size=15/ br / html:submitSubmit/html:submit /html:form My Form: private String field1; private String field2; public void reset(ActionMapping arg0, HttpServletRequest arg1) { field1 = Test Field1; field2 = Test Field2; } public String getField1() { return field1; } public String getField2() { return field2; } public void setField1(String field1) { this.field1 = field1; } public void setField2(String field2) { this.field2 = field2; } My Action: public ActionForward execute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) { HttpSession session = aRequest.getSession(); if ( aForm == null ) { System.out.println(Test Form is null. Creating new one...); aForm = new TestForm(); } TestForm testForm = (TestForm) aForm; testForm.setField1(Filed1 value from action); testForm.setField2(Field2 value from action); if (request.equals(aMapping.getScope())) { aRequest.setAttribute(aMapping.getAttribute(), testForm); } else { session.setAttribute(aMapping.getAttribute(), testForm); } return aMapping.findForward(Constants.SUCCESS); } My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
RE: JSP not displaying data when in Edit Mode
Actually, I didn't have any missing closing tags. Adding scope to saveTestPage action map, I was able to get my testPage action working properly. [EMAIL PROTECTED] 08/28/03 09:23AM What you cut and pasted suggested a typo of a missing closing slash before the end of the action tag: action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm Should've been either: action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm/ OR action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm !-- something could go here, forwards, set paramters, etc -- /actino Regards, David -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2003 10:05 AM To: [EMAIL PROTECTED] Subject: Re: JSP not displaying data when in Edit Mode I have resolved this issue. But can not explain how it is fixed. :-) Can any of the struts gurus out there shed some light on why this is so? My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action By replacing following line action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm with action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm scope=request /action /action-mappings I was able to get my TestForm.jsp display data and get it into edit mode. Though I am only trying to access http://localhost/myapp/testPage.do, I am not sure why NOT HAVING SCOPE in /saveTestPage action made it not to display data given in TestForm. Any ideas? [EMAIL PROTECTED] 08/27/03 02:13PM All, I am trying to get my JSP to display data from my form when in Edit mode. I am new to Struts and using Struts 1.1 I am not sure what I am doing wrong. Any help or pointers at resources would be appreciated. I have included my struts-config, my jsp, my action class and my form class. When I load my jsp, I am expecting to see Filed1 value from action in field1 as defined in the action class. However, I am seeing the default Test Field1 as defined in the ActionForm class. One thing I noticed is, my form is null in action execute class and I see 'Test Form is null. Creating new one... in the console. Any idea what I am doing wrong? TIA - Srinivas My JSP: [EMAIL PROTECTED] language=java import=mybean.*% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:form action=saveTestPage Field 1 : html:text property=field1 size=15/br / Field 2 : html:text property=field2 size=15/ br / html:submitSubmit/html:submit /html:form My Form: private String field1; private String field2; public void reset(ActionMapping arg0, HttpServletRequest arg1) { field1 = Test Field1; field2 = Test Field2; } public String getField1() { return field1; } public String getField2() { return field2; } public void setField1(String field1) { this.field1 = field1; } public void setField2(String field2) { this.field2 = field2; } My Action: public ActionForward execute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) { HttpSession session = aRequest.getSession(); if ( aForm == null ) { System.out.println(Test Form is null. Creating new one...); aForm = new TestForm(); } TestForm testForm = (TestForm) aForm; testForm.setField1(Filed1 value from action); testForm.setField2(Field2 value from action); if (request.equals(aMapping.getScope())) { aRequest.setAttribute(aMapping.getAttribute(), testForm); } else { session.setAttribute(aMapping.getAttribute(), testForm); } return aMapping.findForward(Constants.SUCCESS); } My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm
Re: JSP not displaying data when in Edit Mode
I think that form beans default to session scope. But you specified scope=request in /testPage, so that is where the form bean would be stored. Your /saveTestPage was looking in session scope for the form bean but of course it wasn't stored there. You could leave the scope out of both actions and it should still work. Srinivas Gunturu wrote: I have resolved this issue. But can not explain how it is fixed. :-) Can any of the struts gurus out there shed some light on why this is so? My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action By replacing following line action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm with action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm scope=request /action /action-mappings I was able to get my TestForm.jsp display data and get it into edit mode. Though I am only trying to access http://localhost/myapp/testPage.do, I am not sure why NOT HAVING SCOPE in /saveTestPage action made it not to display data given in TestForm. Any ideas? [EMAIL PROTECTED] 08/27/03 02:13PM All, I am trying to get my JSP to display data from my form when in Edit mode. I am new to Struts and using Struts 1.1 I am not sure what I am doing wrong. Any help or pointers at resources would be appreciated. I have included my struts-config, my jsp, my action class and my form class. When I load my jsp, I am expecting to see Filed1 value from action in field1 as defined in the action class. However, I am seeing the default Test Field1 as defined in the ActionForm class. One thing I noticed is, my form is null in action execute class and I see 'Test Form is null. Creating new one... in the console. Any idea what I am doing wrong? TIA - Srinivas My JSP: [EMAIL PROTECTED] language=java import=mybean.*% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:form action=saveTestPage Field 1 : html:text property=field1 size=15/br / Field 2 : html:text property=field2 size=15/ br / html:submitSubmit/html:submit /html:form My Form: private String field1; private String field2; public void reset(ActionMapping arg0, HttpServletRequest arg1) { field1 = Test Field1; field2 = Test Field2; } public String getField1() { return field1; } public String getField2() { return field2; } public void setField1(String field1) { this.field1 = field1; } public void setField2(String field2) { this.field2 = field2; } My Action: public ActionForward execute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) { HttpSession session = aRequest.getSession(); if ( aForm == null ) { System.out.println(Test Form is null. Creating new one...); aForm = new TestForm(); } TestForm testForm = (TestForm) aForm; testForm.setField1(Filed1 value from action); testForm.setField2(Field2 value from action); if (request.equals(aMapping.getScope())) { aRequest.setAttribute(aMapping.getAttribute(), testForm); } else { session.setAttribute(aMapping.getAttribute(), testForm); } return aMapping.findForward(Constants.SUCCESS); } My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings - 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] -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP not displaying data when in Edit Mode
All, I am trying to get my JSP to display data from my form when in Edit mode. I am new to Struts and using Struts 1.1 I am not sure what I am doing wrong. Any help or pointers at resources would be appreciated. I have included my struts-config, my jsp, my action class and my form class. When I load my jsp, I am expecting to see Filed1 value from action in field1 as defined in the action class. However, I am seeing the default Test Field1 as defined in the ActionForm class. One thing I noticed is, my form is null in action execute class and I see 'Test Form is null. Creating new one... in the console. Any idea what I am doing wrong? TIA - Srinivas My JSP: [EMAIL PROTECTED] language=java import=mybean.*% %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:form action=saveTestPage Field 1 : html:text property=field1 size=15/br / Field 2 : html:text property=field2 size=15/ br / html:submitSubmit/html:submit /html:form My Form: private String field1; private String field2; public void reset(ActionMapping arg0, HttpServletRequest arg1) { field1 = Test Field1; field2 = Test Field2; } public String getField1() { return field1; } public String getField2() { return field2; } public void setField1(String field1) { this.field1 = field1; } public void setField2(String field2) { this.field2 = field2; } My Action: public ActionForward execute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) { HttpSession session = aRequest.getSession(); if ( aForm == null ) { System.out.println(Test Form is null. Creating new one...); aForm = new TestForm(); } TestForm testForm = (TestForm) aForm; testForm.setField1(Filed1 value from action); testForm.setField2(Field2 value from action); if (request.equals(aMapping.getScope())) { aRequest.setAttribute(aMapping.getAttribute(), testForm); } else { session.setAttribute(aMapping.getAttribute(), testForm); } return aMapping.findForward(Constants.SUCCESS); } My struts-config.xml form-beans form-bean name=testForm type=mybean.TestForm / /form-beans action-mappings action path=/testPage type=myaction.TestAction attribute=testForm scope=request validate=false forward name=success path=/TestForm.jsp/ /action action path=/saveTestPage type=myaction.DummyAction input=/TestForm.jsp name=testForm /action /action-mappings - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem on displaying table keys, please help
Not sure about how you've named you methods for one.. for getIndustryId() bean:write name=Detail property=industryId / This has always been the case with JSP tags even if you use jsp:getProperty name=Detail property=industryId / if you dislike the lowercaseization(such a credit to the english language :o) ) of the first letter you could revert to %= Detail.getIndustryId() % or something like this in jstl (not sure how the casing works). c:out value=${Detail.industryId} / I'm not sure whether there's a standard for naming the objects you scope. But as I don't know I wont say. In terms of conventions Detail would be detail but I dont know if this is merely style rather than standard. Cheers Mark On Thursday, August 21, 2003, at 06:25 AM, Andy Cheng wrote: When I try to display a value from the action form, I use bean:write tag, it is fine for Strings, dates etc, but it is not for tables keys, such as: bean:write name=Detail property=IndustryId/ which will give me 1,2,3,4 etc. I have some HashMap in the servletContext already, they contain the content of these small tables. Would someone please suggest me an easy way of doing this? Thanks Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem on displaying table keys, please help
When I try to display a value from the action form, I use bean:write tag, it is fine for Strings, dates etc, but it is not for tables keys, such as: bean:write name=Detail property=IndustryId/ which will give me 1,2,3,4 etc. I have some HashMap in the servletContext already, they contain the content of these small tables. Would someone please suggest me an easy way of doing this? Thanks Andy
Re: Displaying a single error message for multiple properties
At the beginning I had also some problems using validation. Since I understand the power of validation it's one of the coolest thing... Validation displays you automatic one error message for multiple properties. To check if a property is empty or not, use required in your validation.xml. To compare two fields see section Comparing Two Fields at: http://jakarta.apache.org/struts/userGuide/dev_validator.html If you follow all the steps it will solve your problem. For an example how I solved a validation problem see a prior posting at: http://marc.theaimsgroup.com/?l=struts-userm=106068603102209w=2 hope this helps Koni Original Message Subject: Displaying a single error message for multiple properties Date: Mon, 18 Aug 2003 11:41:30 +1000 From: James JKE95 Kerridge [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Just starting to use Struts in anger I have found an inflexibility in the Struts error model that I need to get around. Basically I want to be able to raise a single ActionError for 2 properties. e.g. a password field and a confirm password field exist if they don't match then I want to display one message saying Password and confirmation password don't match I also want to highlight both fields. To highlight both fields I would ideally raise a single error for each property. Sadly the model doesn't seem to support multiple properties for a single error. It seems that my choices will be to create a dodgy convention when raising messages and have a special tag lib for displaying them. Has anyone found a nice way of doing this. It must a problem everyone has faced because surely most web apps have cross field validation and want to have a single error message that relates to the fields involved in the cross validation. e.g. field B cannot be foo when field A is bar. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au -- visit us at: http://www.rothweb.ch http://www.rothconsulting.com Jump and the earth will rise to meet you! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying a single error message for multiple properties
Koni, thanks for your effort. I can now raise the one error message for as many properties. Though I think my solution will be to raise multiple messages (each the same) against the grouping of properties on error. Then I will write a taglib that extends the the logic:getMessages and add a dedupe=true|false attribute. This way I can still test if each of the properties are individually in error and still only display one general message at the top. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au
Displaying a single error message for multiple properties
Just starting to use Struts in anger I have found an inflexibility in the Struts error model that I need to get around. Basically I want to be able to raise a single ActionError for 2 properties. e.g. a password field and a confirm password field exist if they don't match then I want to display one message saying Password and confirmation password don't match I also want to highlight both fields. To highlight both fields I would ideally raise a single error for each property. Sadly the model doesn't seem to support multiple properties for a single error. It seems that my choices will be to create a dodgy convention when raising messages and have a special tag lib for displaying them. Has anyone found a nice way of doing this. It must a problem everyone has faced because surely most web apps have cross field validation and want to have a single error message that relates to the fields involved in the cross validation. e.g. field B cannot be foo when field A is bar. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au
Re: Displaying a single error message for multiple properties
What you want to acheive is not impossible. In your action form you just need to handle this in your validate method. It's pretty simple : if(!password.equals(username)) { //Add whatever action error here, //and it will be returned to the input page. } There's no need for you to write special taglibs to do this, as there is already a html:error tag that does this. James JKE95 Kerridge wrote: Basically I want to be able to raise a single ActionError for 2 properties. e.g. a password field and a confirm password field exist if they don't match then I want to display one message saying Password and confirmation password don't match I also want to highlight both fields. To highlight both fields I would ideally raise a single error for each property. Sadly the model doesn't seem to support multiple properties for a single error. It seems that my choices will be to create a dodgy convention when raising messages and have a special tag lib for displaying them. Has anyone found a nice way of doing this. It must a problem everyone has faced because surely most web apps have cross field validation and want to have a single error message that relates to the fields involved in the cross validation. e.g. field B cannot be foo when field A is bar. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying a single error message for multiple properties
Kwok, thanks for the reply. My problem is not as simple as that. What I want to do is display a single error which relates to 2 different fields. In the view I wish to highlight both of the fields that are in error and display only 1 error message that relates to both. Not just 1. As this must be a standard requirement I was wondering how others have implemented this and whether there is a 'standard' approach that might be followed/copied. Cheers James From: Kwok Peng Tuck [EMAIL PROTECTED] on 18/08/2003 10:06 ZE8 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: Displaying a single error message for multiple properties What you want to acheive is not impossible. In your action form you just need to handle this in your validate method. It's pretty simple : if(!password.equals(username)) { //Add whatever action error here, //and it will be returned to the input page. } There's no need for you to write special taglibs to do this, as there is already a html:error tag that does this. James JKE95 Kerridge wrote: Basically I want to be able to raise a single ActionError for 2 properties. e.g. a password field and a confirm password field exist if they don't match then I want to display one message saying Password and confirmation password don't match I also want to highlight both fields. To highlight both fields I would ideally raise a single error for each property. Sadly the model doesn't seem to support multiple properties for a single error. It seems that my choices will be to create a dodgy convention when raising messages and have a special tag lib for displaying them. Has anyone found a nice way of doing this. It must a problem everyone has faced because surely most web apps have cross field validation and want to have a single error message that relates to the fields involved in the cross validation. e.g. field B cannot be foo when field A is bar. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au
Re: Displaying a single error message for multiple properties
You seem to have missed the point about my response. In this section : if(!password.equals(username)) { //Add whatever action error here, //and it will be returned to the input page. } The action error that you create will contain the message you want. Just select or create the message that you need. It will be returned to the page. You of course need to define the text in the message resource properties first. I understand that this is only a code snippet and may only serve to confuse you, if this is the case have a look at some of the samples(source, specifically classes which extend ActionForm) that come with of Struts. James JKE95 Kerridge wrote: Kwok, thanks for the reply. My problem is not as simple as that. What I want to do is display a single error which relates to 2 different fields. In the view I wish to highlight both of the fields that are in error and display only 1 error message that relates to both. Not just 1. As this must be a standard requirement I was wondering how others have implemented this and whether there is a 'standard' approach that might be followed/copied. Cheers James From: Kwok Peng Tuck [EMAIL PROTECTED] on 18/08/2003 10:06 ZE8 Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: Displaying a single error message for multiple properties What you want to acheive is not impossible. In your action form you just need to handle this in your validate method. It's pretty simple : if(!password.equals(username)) { //Add whatever action error here, //and it will be returned to the input page. } There's no need for you to write special taglibs to do this, as there is already a html:error tag that does this. James JKE95 Kerridge wrote: Basically I want to be able to raise a single ActionError for 2 properties. e.g. a password field and a confirm password field exist if they don't match then I want to display one message saying Password and confirmation password don't match I also want to highlight both fields. To highlight both fields I would ideally raise a single error for each property. Sadly the model doesn't seem to support multiple properties for a single error. It seems that my choices will be to create a dodgy convention when raising messages and have a special tag lib for displaying them. Has anyone found a nice way of doing this. It must a problem everyone has faced because surely most web apps have cross field validation and want to have a single error message that relates to the fields involved in the cross validation. e.g. field B cannot be foo when field A is bar. Cheers James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying a single error message for multiple properties
Kwok, thanks for bearing with me. I think I getting it. So your example is saying. I can compare the 2 properties. Then I can raise 1 action error for it. That's seems fine. Then I get to the input page and I display the one error somewhere which can be donn with just html:errors/ if I want (though I will use logic:messages tags). Then I want to redisplay the property fields on the screen differently (i.e. orange label text) because they are in error. So I can use logic:messagesPresent property=username or logic:messagesPresent property=password depending on which property I raised the error against to test whether I should highlight the field. So with this strategy if an error exists for the username (or password field) I end up highlighting both fields in error. Which is fine, if all I want to validate is that they are equal but I may wish to validate separately that both fields are filled in. In this case only one of the fields may be blank and I may want to only highlight one of the fields not both. So my solution in this case may be to either raise an error against a special property name i.e. username,password when raising one message for multiple fields and then handling the test for errors using a specialized tag lib perhaps. However, I worry that this approach goes against conventions for using the error model. I would not have this issue if I could add an action error against multiple properties. Anyway thanks for your help. I shall continue to ponder the most elegant way of encoding data into either the property key or the message itself. Or just raise 2 error messages exactly the same for each of the 2 fields and dedupe the message when displaying it. Anyone see issues with these approaches. James ***Confidentiality and Privilege Notice*** This email is intended only to be read or used by the addressee. It is confidential and may contain legally privileged information. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone, and you should destroy this message and kindly notify the sender by reply email. Confidentiality and legal privilege are not waived or lost by reason of mistaken delivery to you. Qantas Airways Limited ABN 16 009 661 901 Visit Qantas online at http://www.qantas.com.au
Re: Displaying an incorrect email using email validator
hi, email error message requires only one variable i guessso u should be using arg0 name="email" key="${var:email}" resource="false"-- nagi ---Original Message--- From: Struts Users Mailing List Date: Monday, August 11, 2003 04:17:44 PM To: [EMAIL PROTECTED] Subject: Displaying an incorrect email using email validator Hi everyone,I currently have a JSP page with a textbox that holds email data which is to be validated using the struts validator. Currently with other types of validations one can view the output the value of the textbox using the arg1 name="xxx" key="${var:xxx}" resource="false" tag within the field/field tags inside the validation xml. The problem I'm having here is that how is one able to view the value of an email validation?Currently I try to use the following syntax to view the output of any email value:arg1 name="email" key="${var:email}" resource="false"This doesn't work however. It works if I were to use it within the context of a maxLength or minLength but not email. Why is this so and what is the correct way of doing it?ThanksJohn_MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]. IncrediMail - Email has finally evolved - Click Here
Re: Displaying an incorrect email using email validator
I actually did use that but nothing was being returned. All it showed was a null. From: Nagendra Kumar O V S [EMAIL PROTECTED] Reply-To: Nagendra Kumar O V S [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Displaying an incorrect email using email validator Date: Mon, 11 Aug 2003 16:45:00 +0530 hi, email error message requires only one variable i guess so u should be using arg0 name=email key=${var:email} resource=false -- nagi ---Original Message--- From: Struts Users Mailing List Date: Monday, August 11, 2003 04:17:44 PM To: [EMAIL PROTECTED] Subject: Displaying an incorrect email using email validator Hi everyone, I currently have a JSP page with a textbox that holds email data which is to be validated using the struts validator. Currently with other types of validations one can view the output the value of the textbox using the arg1 name=xxx key=${var:xxx} resource=false tag within the field/field tags inside the validation xml. The problem I'm having here is that how is one able to view the value of an email validation? Currently I try to use the following syntax to view the output of any email value: arg1 name=email key=${var:email} resource=false This doesn't work however. It works if I were to use it within the context of a maxLength or minLength but not email. Why is this so and what is the correct way of doing it? Thanks John _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - 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]
Displaying an incorrect email using email validator
Hi everyone, I currently have a JSP page with a textbox that holds email data which is to be validated using the struts validator. Currently with other types of validations one can view the output the value of the textbox using the arg1 name=xxx key=${var:xxx} resource=false tag within the field/field tags inside the validation xml. The problem I'm having here is that how is one able to view the value of an email validation? Currently I try to use the following syntax to view the output of any email value: arg1 name=email key=${var:email} resource=false This doesn't work however. It works if I were to use it within the context of a maxLength or minLength but not email. Why is this so and what is the correct way of doing it? Thanks John _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
displaying errors relative to a form within JSP
Afternoon all, I'm currently trying to figure out if it is possible to display a set of errors relative to a form within a JSP page. I currently have a JSP page that includes two forms (Both extending ValidatorForm). Both of these forms contain a field named criteria, in both the forms this field is required and validated with the validator plugin. When the user submits one of these forms without the required criteria field they are returned to the input page (containing both the forms). I am hoping to display the errors from the form submission above the form that the errors are associated with. Is this possible? And if so, how would I achieve it? Cheers, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Process Action before displaying index page...
I have an action class that I would like to call before the index page is displayed because elements of the index page are dependant on the action class putting an object in the request scope. I thought that the best way to specify this would be to declare an action in the struts-config.xml file with a path of / which would then forward to the index.jsp page. However, apparently the single root context / is not recognized as a valid path by the struts-config file. Anyone have any sugguestions for how I can solve this problem? Thanks in advance... Keith -- Keith Pemberton [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying errors relative to a form within JSP
I think the easiest thing to do would be to give the fields different names, say criteria1 and criteria2. Perhaps not the most elegant solution, but it should work. Matt - Original Message - From: Daniel Washusen [EMAIL PROTECTED] To: Struts-User [EMAIL PROTECTED] Sent: Monday, August 11, 2003 11:32 PM Subject: displaying errors relative to a form within JSP Afternoon all, I'm currently trying to figure out if it is possible to display a set of errors relative to a form within a JSP page. I currently have a JSP page that includes two forms (Both extending ValidatorForm). Both of these forms contain a field named criteria, in both the forms this field is required and validated with the validator plugin. When the user submits one of these forms without the required criteria field they are returned to the input page (containing both the forms). I am hoping to display the errors from the form submission above the form that the errors are associated with. Is this possible? And if so, how would I achieve it? Cheers, Dan - 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: Process Action before displaying index page...
Why not start a struts plugin which will do the needful - Original Message - From: Keith Pemberton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 5:15 PM Subject: Process Action before displaying index page... I have an action class that I would like to call before the index page is displayed because elements of the index page are dependant on the action class putting an object in the request scope. I thought that the best way to specify this would be to declare an action in the struts-config.xml file with a path of / which would then forward to the index.jsp page. However, apparently the single root context / is not recognized as a valid path by the struts-config file. Anyone have any sugguestions for how I can solve this problem? Thanks in advance... Keith -- Keith Pemberton [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: Process Action before displaying index page...
That worked like a champ. Thanks so much for a straight forward and simple answer! Keith On Tue, 2003-08-12 at 06:47, Vipin Bhatia wrote: Why not start a struts plugin which will do the needful - Original Message - From: Keith Pemberton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 5:15 PM Subject: Process Action before displaying index page... I have an action class that I would like to call before the index page is displayed because elements of the index page are dependant on the action class putting an object in the request scope. I thought that the best way to specify this would be to declare an action in the struts-config.xml file with a path of / which would then forward to the index.jsp page. However, apparently the single root context / is not recognized as a valid path by the struts-config file. Anyone have any sugguestions for how I can solve this problem? Thanks in advance... Keith -- Keith Pemberton [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] -- Keith Pemberton [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:errors/ not displaying the errors?
Hello, I'm using DynaValidatorForm to check certain form fields are entered as required. The validation is done sucessfully but I've recently added somthing that seems to have stopped html:errors/ from displaying the errors? Does anyone have any suggestions why this might have happened? is there a common mistake that might have caused this? or any tips on how to go about debugging it? regards James
RE: html:errors/ not displaying the errors?
The errors tag consults a pageContext attribute (I believe in the request) which has a key of Globals.ERROR_KEY (unless you are in a module then I think the key is [Globals.ERROR_KEY + /modulename]) I guess you could start by seeing if the key exists in your JSP. -Original Message- From: James Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: html:errors/ not displaying the errors? Hello, I'm using DynaValidatorForm to check certain form fields are entered as required. The validation is done sucessfully but I've recently added somthing that seems to have stopped html:errors/ from displaying the errors? Does anyone have any suggestions why this might have happened? is there a common mistake that might have caused this? or any tips on how to go about debugging it? regards James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:errors/ not displaying the errors?
I forgot to mention that the only time I can remember that happening is when I first when to modules and I tried making my own custom bundle for messages in my module's struts config. Error messages weren't showing up because of the custom resource bundle name in my modules. As soon as I got rid of the custom bundle name in the module the errors showed up. -Original Message- From: James Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: html:errors/ not displaying the errors? Hello, I'm using DynaValidatorForm to check certain form fields are entered as required. The validation is done sucessfully but I've recently added somthing that seems to have stopped html:errors/ from displaying the errors? Does anyone have any suggestions why this might have happened? is there a common mistake that might have caused this? or any tips on how to go about debugging it? regards James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying is easy, capturing is not..
Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Displaying is easy, capturing is not..
Hello Mona, is ABC is bean that has six properties that you need to show? and then you have a collection of ABC objects in a List or Vector? if so, you can use the indexed properties to capture all the changes done on the page. and yes, usually one submit button is enough for six hundred values!!! ATTA - Original Message - From: Alawadhi, Mona [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:32 AM Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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: Displaying is easy, capturing is not..
How can I do that using one submit button? Yes, see the discussions about indexed properties this week. That's what they're for. -TPP - This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying is easy, capturing is not..
Use Map Backed Beans for that... Panchasheel -Original Message- From: Alawadhi, Mona [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 1:32 PM To: Struts Users Mailing List Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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: Displaying is easy, capturing is not..
Mona, I don't think the user's browser will handle many more than 50 (a guess) much less 600 text input elements on a single page. I think you should re-think the UI so that fewer input elements are needed. Handling 600 input fields on the server side will take a long time (several seconds to a few minutes). -Richard -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:50 AM To: Struts Users Mailing List Subject: Re: Displaying is easy, capturing is not.. Hello Mona, is ABC is bean that has six properties that you need to show? and then you have a collection of ABC objects in a List or Vector? if so, you can use the indexed properties to capture all the changes done on the page. and yes, usually one submit button is enough for six hundred values!!! ATTA - Original Message - From: Alawadhi, Mona [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:32 AM Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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: Displaying is easy, capturing is not..
Thank you - I am definately considering that. I'll probably limit the user. -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 2:04 PM To: 'Struts Users Mailing List' Subject: RE: Displaying is easy, capturing is not.. Mona, I don't think the user's browser will handle many more than 50 (a guess) much less 600 text input elements on a single page. I think you should re-think the UI so that fewer input elements are needed. Handling 600 input fields on the server side will take a long time (several seconds to a few minutes). -Richard -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:50 AM To: Struts Users Mailing List Subject: Re: Displaying is easy, capturing is not.. Hello Mona, is ABC is bean that has six properties that you need to show? and then you have a collection of ABC objects in a List or Vector? if so, you can use the indexed properties to capture all the changes done on the page. and yes, usually one submit button is enough for six hundred values!!! ATTA - Original Message - From: Alawadhi, Mona [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:32 AM Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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] * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Displaying is easy, capturing is not..
Mona, You might consider first displaying the values and providing an edit button next to the values. If the user presses the edit button, then the row is displayed as editable fields. Another solution might be to use check boxes to select which rows should be edited and then present only those rows (limiting it to a reasonable number) on the next page to edit. Look at how a web mail application works. Regards, Richard -Original Message- From: Alawadhi, Mona [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 11:36 AM To: 'Struts Users Mailing List' Subject: RE: Displaying is easy, capturing is not.. Thank you - I am definately considering that. I'll probably limit the user. -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 2:04 PM To: 'Struts Users Mailing List' Subject: RE: Displaying is easy, capturing is not.. Mona, I don't think the user's browser will handle many more than 50 (a guess) much less 600 text input elements on a single page. I think you should re-think the UI so that fewer input elements are needed. Handling 600 input fields on the server side will take a long time (several seconds to a few minutes). -Richard -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:50 AM To: Struts Users Mailing List Subject: Re: Displaying is easy, capturing is not.. Hello Mona, is ABC is bean that has six properties that you need to show? and then you have a collection of ABC objects in a List or Vector? if so, you can use the indexed properties to capture all the changes done on the page. and yes, usually one submit button is enough for six hundred values!!! ATTA - Original Message - From: Alawadhi, Mona [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 10:32 AM Subject: Displaying is easy, capturing is not.. Hello Everyone, I wonder if someone can help me with this problem. I would appreciate any smart suggestion. I have a JSP that displays a collection (ValueObject fields) Let's call the collection ABC - it consists of 6 items. I might have more than one ABC collections to display. This can be done by setting a Vector which consists of a number of ABC collections, and simply I can iterate through the Vector in my JSP and display all the ABC collections I have using textboxes. When the user tries to change any of those textboxes, I should be able to capture them. I have one submit button that I am using, and if, for example, I have two ABC's there, I should be able to capture all 12 items. (note that I might have 100 ABCs, in which case I have to capture 600 items.) How can I do that using one submit button? Thank you in advance, Mona * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - 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] * The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. When addressed to our clients any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing KPMG client engagement letter. * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: html:errors/ not displaying the errors?
Thanks for the help. It turned out I'd added a seperate app.properties file in the init parameters for the struts Action servlet in the web.xml which didn't contain the messages I needed. This caused struts to ignore the app2.properties that I'd specified in the message-resources tag of struts-config.xml file. James www.seventyforty.com - Original Message - From: Bailey, Shane C. [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 3:13 PM Subject: RE: html:errors/ not displaying the errors? I forgot to mention that the only time I can remember that happening is when I first when to modules and I tried making my own custom bundle for messages in my module's struts config. Error messages weren't showing up because of the custom resource bundle name in my modules. As soon as I got rid of the custom bundle name in the module the errors showed up. -Original Message- From: James Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 9:51 AM To: [EMAIL PROTECTED] Subject: html:errors/ not displaying the errors? Hello, I'm using DynaValidatorForm to check certain form fields are entered as required. The validation is done sucessfully but I've recently added somthing that seems to have stopped html:errors/ from displaying the errors? Does anyone have any suggestions why this might have happened? is there a common mistake that might have caused this? or any tips on how to go about debugging it? regards James - 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: Displaying is easy, capturing is not
Dear Rick, I had implemented the JSP as follows: The top part of JSP shows the search form. The bottom part of JSP shows the results. The logic:present tag is used to show the results (the bottom part is not displayed if the Results bean is NULL) Initially, Results bean is NULL and user will see only the top part (Search form). When the user clicks on Search, the Results bean gets initialized, and the user sees both Search and Results. When the user clicks on Reset, the Results bean is set to NULL. The bottom part will disappear because of the logic:present tag. I had posted the code as an example yesterday. Please look in the archives. I hope that my above explanation is not ambigious. Ajay Hi, guys: I have a list for user to select, when user select one item from the list, and hit search button, a results table will be displayed at the bottom half of the page. Now, if user selects another item from the list, I want to refresh the table (or page?) and make the results table disappear before user hit search button again. I have no idea to do this. Can anyone give some thoughts on this? regards, rick Ajay Patil Vertex Software Pvt. Ltd. [EMAIL PROTECTED] http://www.vertex.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Order of displaying errors
I'm displaying the errors using ActionErrors. But the errors are not displayed in the order in which I'm adding them to 'errors' object. For ex., in login page, I have Username field and Password field. If username is NULL, I'm adding Username is null as error message to 'errors' object. If password is NULL, I'm adding Password is null as error message to 'errors' object. So, if both the fields are NULL, I should get the error messages as follows: Username is null Password is null But the order in which the errors are shown is as follows: Password is null Username is null. At the same time, the errors are not being displayed in reverse order also (I've checked this on forms which have multiple input fields). So, how to display the errors in correct order (first in first out)?
RE: Order of displaying errors
ActionErrors - ActionMessages internally used HashMap that means errors may not be retreived in same order as they were added. If you wish, you may extend and implement your own version using TreeMap (Andrew suggested TreeMap few minutes back on this list) to solve your purpose. OR 1. save them in whatever order you wish. 2. In JSP, retreive them using the keys in specific in order you want. -navjot |-Original Message- |From: sriram [mailto:[EMAIL PROTECTED] |Sent: Tuesday, July 08, 2003 12:42 PM |To: 'Struts Users Mailing List' |Subject: Order of displaying errors | | |I'm displaying the errors using ActionErrors. | |But the errors are not displayed in the order in which I'm adding |them to 'errors' object. | |For ex., in login page, I have Username field and Password field. | |If username is NULL, I'm adding Username is null as error |message to 'errors' object. |If password is NULL, I'm adding Password is null as error |message to 'errors' object. | |So, if both the fields are NULL, I should get the error messages |as follows: |Username is null |Password is null | |But the order in which the errors are shown is as follows: |Password is null |Username is null. | |At the same time, the errors are not being displayed in reverse |order also (I've checked this on forms which have multiple input fields). | |So, how to display the errors in correct order (first in first out)? | | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Resource problem displaying validator error arguments
Hi Dusty, I have a similar problem as well. I'll be interested in any replies. Out of curiosity, what are you using BigInteger for? Adam Dustin Sallings wrote: Hello *, Summary: My arguments are always showing up as null (even when its' not a resource), but the message itself is coming out of the resources just fine. I'm having a problem I'm presently unable to figure out. I've got the following validator rules: field property=serialNumber depends=maxlength,biginteger arg0 key=fields.serialNumber resource=false / arg1 name=maxlength key=${var:maxlength} resource=false/ var var-namemaxlength/var-name var-value12/var-value /var /field field property=snDirection depends=required,mask arg0 key=fields.serialNumberPart / var var-namemask/var-name var-value^(start|end)$/var-value /var /field Relevant resource properties are as follows: errors.biginteger={0} does not contain a valid number. errors.invalid={0} is not valid. fields.serialNumber=Serial number fields.serialNumberPart=Serial number part The first one uses a validator I implemented that verifies the input can be converted to a big integer. The second is using mask. Both of these are correctly doing their validation, however, both of them return null for arg0. html:errors produces the following when the input is not valid: null does not contain a valid number. null is not valid. What could I have possibly done to accomplish this? Same thing on 1.1rc2 and 1.1. Thanks. -- Dustin Sallings - 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]
Resource problem displaying validator error arguments
Hello *, Summary: My arguments are always showing up as null (even when its' not a resource), but the message itself is coming out of the resources just fine. I'm having a problem I'm presently unable to figure out. I've got the following validator rules: field property=serialNumber depends=maxlength,biginteger arg0 key=fields.serialNumber resource=false / arg1 name=maxlength key=${var:maxlength} resource=false/ var var-namemaxlength/var-name var-value12/var-value /var /field field property=snDirection depends=required,mask arg0 key=fields.serialNumberPart / var var-namemask/var-name var-value^(start|end)$/var-value /var /field Relevant resource properties are as follows: errors.biginteger={0} does not contain a valid number. errors.invalid={0} is not valid. fields.serialNumber=Serial number fields.serialNumberPart=Serial number part The first one uses a validator I implemented that verifies the input can be converted to a big integer. The second is using mask. Both of these are correctly doing their validation, however, both of them return null for arg0. html:errors produces the following when the input is not valid: null does not contain a valid number. null is not valid. What could I have possibly done to accomplish this? Same thing on 1.1rc2 and 1.1. Thanks. -- Dustin Sallings - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
displaying String[] in struts
hi all. cud somebody tell how i can display contents in a string[] which i return from methodx. I was able to get it iterated to size of array, but i don't knw how to display the content in the array. any help will be greatly appreciated r sasi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: displaying String[] in struts
You could do the following logic:iterate id=mystrings ... bean:write name=mystrings /logic:iterate HTH Filip -Original Message- From: Thamarajah Dharma [mailto:[EMAIL PROTECTED] Sent: Friday, June 27, 2003 9:30 AM To: struts (E-mail) Subject: displaying String[] in struts hi all. cud somebody tell how i can display contents in a string[] which i return from methodx. I was able to get it iterated to size of array, but i don't knw how to display the content in the array. any help will be greatly appreciated r sasi - 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: displaying String[] in struts
i got it.. r sasi -Original Message- From: Thamarajah Dharma Sent: Friday, June 27, 2003 1:30 PM To: struts (E-mail) Subject: displaying String[] in struts hi all. cud somebody tell how i can display contents in a string[] which i return from methodx. I was able to get it iterated to size of array, but i don't knw how to display the content in the array. any help will be greatly appreciated r sasi - 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]
logic:iterate displaying blanks
hi, I had a good search on the user group and could not find any answer for this one. I have a DispatchAction class, called ShowLogsAction that goes away and returns a list of LogItem items. All the properties on LogItem are public eg public String auditDate ShowLogsAction snippet System.out.println(Entering ShowLogAction); ValueListHandler listHandler = new LogListHandler(); DynaActionForm logForm = (DynaActionForm) form; List logs = listHandler.getNextElements(20); ArrayList logList = new ArrayList(); for(Iterator i = logs.iterator(); i.hasNext();){ LogItem log = (LogItem) i.next(); System.out.println(action date= + log.auditDate); logList.add(log); } logForm.set(logList, logList); /snippet I have iterated through the Collection again in the action just to make sure the values are being returned. Everything looks OK to this point. In my jsp, showLogs.jsp, I then iterate over the Collection and print the date and and userNaem properties of the LogItem in the Collection. This is done as so. showLogs.jsp snippet % String forward = /showLogs; % html:form action=%= forward % TABLE border=1 TBODY logic:iterate id=logs name=logsForm property=logList scope=request type=com.cuscal.payments.bpay.enquiry.LogItem TR TDauditDate= bean:write name=logs property=auditDate / /TD TDuser name= bean:write name=logs property=userName / /TD /TR /logic:iterate /TBODY /TABLE /html:form /snippet While I get 20 rows back they are all blank. This is the result. auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= auditDate= user name= Obviously this has caused me hours of amusement. Can anyone think why this would be producing such a result? All suggestions gratefully appreciated. Ralph Roper NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption, interruption or any damage generally as a result of transmission of this email. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate displaying blanks
I think you want to do a html:form action=/showLogs.do ? also, check to see what your html source is for this form line and verify that it is using the name element from your struts-config. sandeep --- RALPH ROPER [EMAIL PROTECTED] wrote: hi, I had a good search on the user group and could not find any answer for this one. I have a DispatchAction class, called ShowLogsAction that goes away and returns a list of LogItem items. All the properties on LogItem are public eg public String auditDate ShowLogsAction snippet System.out.println(Entering ShowLogAction); ValueListHandler listHandler = new LogListHandler(); DynaActionForm logForm = (DynaActionForm) form; List logs = listHandler.getNextElements(20); ArrayList logList = new ArrayList(); for(Iterator i = logs.iterator(); i.hasNext();){ LogItem log = (LogItem) i.next(); System.out.println(action date= + log.auditDate); logList.add(log); } logForm.set(logList, logList); /snippet I have iterated through the Collection again in the action just to make sure the values are being returned. Everything looks OK to this point. In my jsp, showLogs.jsp, I then iterate over the Collection and print the date and and userNaem properties of the LogItem in the Collection. This is done as so. showLogs.jsp snippet % String forward = /showLogs; % html:form action=%= forward % TABLE border=1 TBODY logic:iterate id=logs name=logsForm property=logList scope=request type=com.cuscal.payments.bpay.enquiry.LogItem TR TDauditDate= bean:write name=logs property=auditDate / /TD TDuser name= bean:write name=logs property=userName / /TD /TR /logic:iterate /TBODY /TABLE /html:form /snippet While I get 20 rows back they are all blank. This is the result. auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= auditDate=user name= Obviously this has caused me hours of amusement. Can anyone think why this would be producing such a result? All suggestions gratefully appreciated. Ralph Roper NOTICE The information in this email and or any of the attachments may contain; a. Confidential information of Credit Union Services Corporation (Australia) Limited (CUSCAL) or third parties; and or b. Legally privileged information of CUSCAL or third parties; and or c. Copyright material of CUSCAL or third parties. If you are not an authorised recipient of this email, please contact CUSCAL immediately by return email or by telephone on 61-2-8299 9000 and delete the email from your system. We do not accept any liability in connection with computer virus, data corruption, interruption or any damage generally as a result of transmission of this email. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Displaying an object stored in the http session
Hi all, I've a quick question. I have an object stored in the http session. The object has about 20 parameters. I want to display this object's values in a page. At the moment I was using the bean:write approach passing in the scope being session and the name and parameter values. However, if I use this twenty times, is it not better to define a copy of the bean in page scope once, and then just access that bean's values? Eg: something like - bean:define id=myCopy name=beanInSessionScope . then later on in the page I can just go bean:write name=myCopy etc. Am I worrying about this needlessly - is the optimization going to be negligible? Thanks, brian
Re: Displaying an object stored in the http session
I don't think this optimalisation will have some significant effect. But of course, you could store the object in the page scope. I do the same in some of my actions: in BlahAction.java perform() // there are more arguments here normaly { School school = new School(); school.setPrincipal(John Principal); request.setAttribute(school, school); } in blah.jsp c:out value=${school.principal}/ I use JSTL to display the properties as you can see. This works fine for me. (The School object is out of scope on the next request). I suspect the garbage collector picks it up and destroys the object. Good luck, Harm de Laat Informatiefabriek The Netherlands Brian McSweeney [EMAIL PROTECTED] 06/17/2003 05:17 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject Displaying an object stored in the http session Hi all, I've a quick question. I have an object stored in the http session. The object has about 20 parameters. I want to display this object's values in a page. At the moment I was using the bean:write approach passing in the scope being session and the name and parameter values. However, if I use this twenty times, is it not better to define a copy of the bean in page scope once, and then just access that bean's values? Eg: something like - bean:define id=myCopy name=beanInSessionScope . then later on in the page I can just go bean:write name=myCopy etc. Am I worrying about this needlessly - is the optimization going to be negligible? Thanks, brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]