Form bean property as java variable in page ?
Hi, I have a form bean entry in my struts-config.xml, looks like - form-bean name=myForm type=org.apache.struts.validator.DynaValidatorForm form-property name=pageNumber type=java.lang.String initial=0 / form-property name=numberOfRows type=java.lang.String initial=0 / /form-bean I have a jsp page in which i place this form as - html:form action=/myAction html:hidden property=pageNumber/ html:hidden property=numberOfRows/ /html:form I want the 'pageNumber' and 'numberOfRows' property of the form bean in a java variable in my page. Is there any inbuilt functionality in Struts which i can use to achieve this ? I tried with by placing the following code in my jsp just below the form - bean:define id=numberOfRowsA name=commonOCSForm property=numberOfRows / %= numberOfRowsA % But it gives 'numberOfRowsA' not defined error when run. :-( Please advice. Regards, Janarthan S - Do you Yahoo!? Yahoo! Search - Find what youre looking for faster.
Reset all form bean elements in one shot
Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.
Re: Reset all form bean elements in one shot
Anant: So a brand new form bean won't do the job..? Geeta [EMAIL PROTECTED] wrote: Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reset all form bean elements in one shot
How to remove the form bean element from the session if that's the case -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 2:14 AM To: Struts Users Mailing List Subject: Re: Reset all form bean elements in one shot Anant: So a brand new form bean won't do the job..? Geeta [EMAIL PROTECTED] wrote: Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset all form bean elements in one shot
session.removeAttribute(myForm); myForm = new MyFormBean(); Regards, Geeta [EMAIL PROTECTED] wrote: How to remove the form bean element from the session if that's the case -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 2:14 AM To: Struts Users Mailing List Subject: Re: Reset all form bean elements in one shot Anant: So a brand new form bean won't do the job..? Geeta [EMAIL PROTECTED] wrote: Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Reset all form bean elements in one shot
You can also check if the form bean's reset() method can do the job for you. --- [EMAIL PROTECTED] wrote: How to remove the form bean element from the session if that's the case -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 2:14 AM To: Struts Users Mailing List Subject: Re: Reset all form bean elements in one shot Anant: So a brand new form bean won't do the job..? Geeta [EMAIL PROTECTED] wrote: Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reset all form bean elements in one shot
Thanks I never thought it would be as simple as this... :-) Why didn't I think of this before..:-( -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 2:22 AM To: Struts Users Mailing List Subject: Re: Reset all form bean elements in one shot session.removeAttribute(myForm); myForm = new MyFormBean(); Regards, Geeta [EMAIL PROTECTED] wrote: How to remove the form bean element from the session if that's the case -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Saturday, March 06, 2004 2:14 AM To: Struts Users Mailing List Subject: Re: Reset all form bean elements in one shot Anant: So a brand new form bean won't do the job..? Geeta [EMAIL PROTECTED] wrote: Hi, I wanted to know if there is any way in which we can reset all the elements of the form bean without giving individual resets all the time for e.g I have 4 elements in my form bean. say A,B,C,D I am interested in resetting all the four without giving resetAllElements() { A = null B = null C = null D = null } Note: My form bean has session scope(I need it) Regards Anant Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset all form bean elements in one shot
Anant: [EMAIL PROTECTED] wrote: Thanks I never thought it would be as simple as this... :-) Why didn't I think of this before..:-( If each of us had a penny for every time we thought this, we'd be all set for early retirement in the bahamas..:) Geeta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Capture array from form bean into struts action class
Any samples? Thanks (BAsically I am trying to get list of shoping cart items from my jsp and retrieve them like an array to later send it to my ItemDeleteAction.java class for deleeion.But how to stor the delete array in request or session?Request.setParameter or session permits only String right? and not String array? Thanks. - Do you Yahoo!? Get better spam protection with Yahoo! Mail
Re: Capture array from form bean into struts action class
Tons of samples with discussion in the archives. http://marc.theaimsgroup.com/?l=struts-userw=2r=1s=indexedq=b http://marc.theaimsgroup.com/?l=struts-userm=107600405406119w=2 --- as as [EMAIL PROTECTED] wrote: Any samples? Thanks (BAsically I am trying to get list of shoping cart items from my jsp and retrieve them like an array to later send it to my ItemDeleteAction.java class for deleeion.But how to stor the delete array in request or session?Request.setParameter or session permits only String right? and not String array? Thanks. - Do you Yahoo!? Get better spam protection with Yahoo! Mail __ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Capture array from form bean into struts action class
Hubert, Excellent and thanks for the quick response.I will look and try following these examples! Hubert Rabago [EMAIL PROTECTED] wrote: Tons of samples with discussion in the archives. http://marc.theaimsgroup.com/?l=struts-userw=2r=1s=indexedq=b http://marc.theaimsgroup.com/?l=struts-userm=107600405406119w=2 --- as as wrote: Any samples? Thanks (BAsically I am trying to get list of shoping cart items from my jsp and retrieve them like an array to later send it to my ItemDeleteAction.java class for deleeion.But how to stor the delete array in request or session?Request.setParameter or session permits only String right? and not String array? Thanks. - Do you Yahoo!? Get better spam protection with Yahoo! Mail __ Do you Yahoo!? Get better spam protection with Yahoo! Mail. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Get better spam protection with Yahoo! Mail
Re: Reset method in Form Bean
On Friday 20 February 2004 18:04, Ramachandran wrote: the scope for my form bean is in 'Request Scope' Then, it technically just cannot be unless you set the default values accordingly in your Form Bean. Things in request scope are destroyed when the request | response cycle is finished. That's the case when the resulting page is finally displayed after calling the Action, and not related to Struts itself. If the old values reappear even after a logout (you do call session.invalidate()?, just to make sure), there is something else wrong, even if you were using session-scoped forms. Most certainly you're dealing with stale pages from the browser cache, but I can't tell from the information given. Make sure you have the 'nocache' attribute set in your controller definition in struts-config.xml or issue the appropriate no-cache headers manually. Does the problem persist if you hit the browser's reload button? HTH, -- Chris. -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Friday, February 20, 2004 9:55 PM To: [EMAIL PROTECTED] Subject: Re: Reset method in Form Bean what is the scope your FormBean ??? [EMAIL PROTECTED] 02/20/04 10:32AM Hi, I am having jsp page , which contains a text box for searching. Here i am having form bean for getting and setting value. In this form bean, i use the Reset method for reseting the values for each request. But it is not at all reseting the values each time. The previous value is displayed if we visis the page again. Even if we logged out and login the same value is appearing... Any idea? Help needed Ram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reset method in Form Bean
Hi, I am having jsp page , which contains a text box for searching. Here i am having form bean for getting and setting value. In this form bean, i use the Reset method for reseting the values for each request. But it is not at all reseting the values each time. The previous value is displayed if we visis the page again. Even if we logged out and login the same value is appearing... Any idea? Help needed Ram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reset method in Form Bean
what is the scope your FormBean ??? [EMAIL PROTECTED] 02/20/04 10:32AM Hi, I am having jsp page , which contains a text box for searching. Here i am having form bean for getting and setting value. In this form bean, i use the Reset method for reseting the values for each request. But it is not at all reseting the values each time. The previous value is displayed if we visis the page again. Even if we logged out and login the same value is appearing... Any idea? Help needed Ram - 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: Reset method in Form Bean
the scope for my form bean is in 'Request Scope' -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Friday, February 20, 2004 9:55 PM To: [EMAIL PROTECTED] Subject: Re: Reset method in Form Bean what is the scope your FormBean ??? [EMAIL PROTECTED] 02/20/04 10:32AM Hi, I am having jsp page , which contains a text box for searching. Here i am having form bean for getting and setting value. In this form bean, i use the Reset method for reseting the values for each request. But it is not at all reseting the values each time. The previous value is displayed if we visis the page again. Even if we logged out and login the same value is appearing... Any idea? Help needed Ram - 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: Reset method in Form Bean
We had same issues like this in the beginning I remember and we have started calling reset explicitly on each ADD \ EDIT \ CANCAL \ DELETE in Action. [EMAIL PROTECTED] 02/20/04 11:04AM the scope for my form bean is in 'Request Scope' -Original Message- From: Srinivas Kusunam [mailto:[EMAIL PROTECTED] Sent: Friday, February 20, 2004 9:55 PM To: [EMAIL PROTECTED] Subject: Re: Reset method in Form Bean what is the scope your FormBean ??? [EMAIL PROTECTED] 02/20/04 10:32AM Hi, I am having jsp page , which contains a text box for searching. Here i am having form bean for getting and setting value. In this form bean, i use the Reset method for reseting the values for each request. But it is not at all reseting the values each time. The previous value is displayed if we visis the page again. Even if we logged out and login the same value is appearing... Any idea? Help needed Ram - 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]
String[] in the form bean
Wendy, Thanks for the quick reply. I did as follows but get the error: javax.servlet.jsp.JspException: No getter method available for property ids for bean under name org.apache.struts.taglib.html.BEAN Though I have getters in my bean and I made ids as a hidden field in my jsp. Thanks, Samy -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 5:05 PM To: Struts Users Mailing List Subject: RE: [OT] - Request against Session From: Samyukta Akunuru [mailto:[EMAIL PROTECTED] Using session/hidden variables-what would be the best way to carry the array of selected checkboxes to the next page. (Please trim your posts.) I assume there's a String[] in your form bean. You can iterate over it and write out several html:hidden tags with the appropriate values. Struts should fill up your String[] property again when the resulting form is submitted. But just putting the form bean in session scope should solve it. You'll have to be careful in the 'reset' method, but other than that the form bean will keep all your values as you go along. action path=/accountInquiry type=com.example.AccountInquiryAction name=accountForm scope=session ... -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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: String[] in the form bean
Can you Post your JSP and FormBean ?? At least that gives some idea about what you are doing there. Thanks, Srini [EMAIL PROTECTED] 02/12/04 02:12PM Wendy, Thanks for the quick reply. I did as follows but get the error: javax.servlet.jsp.JspException: No getter method available for property ids for bean under name org.apache.struts.taglib.html.BEAN Though I have getters in my bean and I made ids as a hidden field in my jsp. Thanks, Samy -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 5:05 PM To: Struts Users Mailing List Subject: RE: [OT] - Request against Session From: Samyukta Akunuru [mailto:[EMAIL PROTECTED] Using session/hidden variables-what would be the best way to carry the array of selected checkboxes to the next page. (Please trim your posts.) I assume there's a String[] in your form bean. You can iterate over it and write out several html:hidden tags with the appropriate values. Struts should fill up your String[] property again when the resulting form is submitted. But just putting the form bean in session scope should solve it. You'll have to be careful in the 'reset' method, but other than that the form bean will keep all your values as you go along. action path=/accountInquiry type=com.example.AccountInquiryAction name=accountForm scope=session ... -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - 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 : Beginner question: form bean executing but action class not
The easiest way to learn is look at the working example(and from book of course). Struts comes with great example. Compare your xml configurations and other things(such as tags), with, say struts-example/web-inf/struts-config.xml. __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Beginner question: form bean executing but action class not
you don't supply the controller controller / I hope this helps, Fredrich - Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online
Beginner question: form bean executing but action class not
Hi, I have gotten my first extremely simple (2 web pages) Struts application working and am slowly adding features to it. In first page, you enter data into a form and click the submit button. This takes you to the second page, which displays the data from the form; and clicking the submit button on this page takes you back to the first page--very simple. My problem is that for the first page (entryPage.jsp), its form bean, EntryForm.java seems to be executing, but the corresponding action class, EntryAction.java does not. I have checked two very good books and have checked my code against sample code, but i can't figure out what's different. Below, I've listed the struts-config.xml and EntryAction.java files. I know I must be overlooking something incredibly simple. Thanks for your help. ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config data-sources/ form-beans form-bean name=entryForm type=sample.EntryForm/ form-bean name=displayForm type=sample.DisplayForm/ /form-beans global-exceptions/ global-forwards forward name=begin path=/Display.do/ /global-forwards action-mappings action name=entryForm path=/Entry scope=request type=sample.EntryAction forward name=displayPage path=/pages/displayPage.jsp/ /action action name=displayForm path=/Display scope=request type=sample.DisplayAction forward name=entryPage path=/pages/entryPage.jsp/ /action /action-mappings controller/ /struts-config package sample; import java.io.*; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.struts.action.DynaActionForm; import org.apache.struts.util.MessageResources; public class EntryAction extends org.apache.struts.action.Action { // Global Forwards public static final String GLOBAL_FORWARD_begin = begin; // Local Forwards private static final String FORWARD_displayPage = displayPage; public EntryAction() { System.out.println (EntryAction: Reached constructor method); } public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // TODO: Write method body return mapping.findForward(FORWARD_displayPage); } } * end * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
disable html:text using form bean element
hi, Can I use a form bean element (java.lang.Boolean) to disable a html:text dynamically depending on its value. is yes then how can I do it? thanks Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments.
Making the fields non editable dynamically using a form bean element
Hi ppl, I have a situation where I do not want the user to edit the fields if the history record flag in the form bean is true. Can you suggest me how to go about it. Can I use a form bean element (java.lang.Boolean/String) to disable a html:text dynamically depending on its value. If yes then how can I do it? Thanks a ton in advance Regards Anant Parnami Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Making the fields non editable dynamically using a form bean element
guess there is some attribute called readonly for html:text. set that to true. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 4:06 PM To: [EMAIL PROTECTED] Subject: Making the fields non editable dynamically using a form bean element Hi ppl, I have a situation where I do not want the user to edit the fields if the history record flag in the form bean is true. Can you suggest me how to go about it. Can I use a form bean element (java.lang.Boolean/String) to disable a html:text dynamically depending on its value. If yes then how can I do it? Thanks a ton in advance Regards Anant Parnami Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Making the fields non editable dynamically using a form bean element
I have to set that statically i-e html:text readonly=true My problem is to try to do that dynamically, I have a flag in form bean, if that is true then disable the textbox else if false then enable it -Original Message- From: Navjot Singh [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 5:49 PM To: Struts Users Mailing List Subject: RE: Making the fields non editable dynamically using a form bean element guess there is some attribute called readonly for html:text. set that to true. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 4:06 PM To: [EMAIL PROTECTED] Subject: Making the fields non editable dynamically using a form bean element Hi ppl, I have a situation where I do not want the user to edit the fields if the history record flag in the form bean is true. Can you suggest me how to go about it. Can I use a form bean element (java.lang.Boolean/String) to disable a html:text dynamically depending on its value. If yes then how can I do it? Thanks a ton in advance Regards Anant Parnami Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Making the fields non editable dynamically using a form bean element
Anant, You can do the following: set up a boolean flag at the top of the jsp page that will be used to disable fields on your page like so: % boolean flag = false; % and then set this according to the value of the flag in your form using logic tags: logic:equal name=FormName property=xxx value=true % flag = true; % /logic:equal logic:equal name=FormName property=xxx value=false % flag = false; % /logic:equal and then in your html:text elements do this: html:text property=xxx disabled=%= flag %/ you have to make sure though that the boolean is set to the right value (so that if you wish to disable something it is true - this got me caught out a few times!) HTH Claire :) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 02, 2004 10:35 AM Subject: Making the fields non editable dynamically using a form bean element Hi ppl, I have a situation where I do not want the user to edit the fields if the history record flag in the form bean is true. Can you suggest me how to go about it. Can I use a form bean element (java.lang.Boolean/String) to disable a html:text dynamically depending on its value. If yes then how can I do it? Thanks a ton in advance Regards Anant Parnami Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Making the fields non editable dynamically using a form bean element
Thanks a ton It worked for me :-) Regards Anant -Original Message- From: Claire Wall [mailto:[EMAIL PROTECTED] Sent: Monday, February 02, 2004 6:09 PM To: Struts Users Mailing List Subject: Re: Making the fields non editable dynamically using a form bean element Anant, You can do the following: set up a boolean flag at the top of the jsp page that will be used to disable fields on your page like so: % boolean flag = false; % and then set this according to the value of the flag in your form using logic tags: logic:equal name=FormName property=xxx value=true % flag = true; % /logic:equal logic:equal name=FormName property=xxx value=false % flag = false; % /logic:equal and then in your html:text elements do this: html:text property=xxx disabled=%= flag %/ you have to make sure though that the boolean is set to the right value (so that if you wish to disable something it is true - this got me caught out a few times!) HTH Claire :) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 02, 2004 10:35 AM Subject: Making the fields non editable dynamically using a form bean element Hi ppl, I have a situation where I do not want the user to edit the fields if the history record flag in the form bean is true. Can you suggest me how to go about it. Can I use a form bean element (java.lang.Boolean/String) to disable a html:text dynamically depending on its value. If yes then how can I do it? Thanks a ton in advance Regards Anant Parnami Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Write values from html-form to ArrayList in form bean
See my earlier reply to the question getting data from form with nested beans or search the user archive on the above key... regards, Shirish -Original Message- From: Matthias Winkler [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 4:16 AM To: [EMAIL PROTECTED] Subject: Write values from html-form to ArrayList in form bean HI, I have a form bean that passes an ArrayList which contains objects of type LineItem. With the iterate-tag I iterate through retrieve every LineItem and I use c:set .../ to access the 'id' attribute and other values of each LineItem object to setup a html form with several checkboxes. (For the checkboxes I use some selfmade tags.) logic:iterate id=lineitem indexId=index name=warehouseForm scope=session property=lineitemlist c:set var=id value=${lineitem.id} / xv:input-checkbox inputId=${id} .../ ... /logic:iterate Now I want the values of the attribute 'checked' of each LineItem inside the ArrayList of the form bean to be changed according to the users selection in the html form. As name for the checkboxes I use the value of the 'id' attribute of each LineItem. Right now no value changes inside the bean. Is it possible to do that? Thanks a lot for your help. Matthias __ 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]
Write values from html-form to ArrayList in form bean
HI, I have a form bean that passes an ArrayList which contains objects of type LineItem. With the iterate-tag I iterate through retrieve every LineItem and I use c:set .../ to access the 'id' attribute and other values of each LineItem object to setup a html form with several checkboxes. (For the checkboxes I use some selfmade tags.) logic:iterate id=lineitem indexId=index name=warehouseForm scope=session property=lineitemlist c:set var=id value=${lineitem.id} / xv:input-checkbox inputId=${id} .../ ... /logic:iterate Now I want the values of the attribute 'checked' of each LineItem inside the ArrayList of the form bean to be changed according to the users selection in the html form. As name for the checkboxes I use the value of the 'id' attribute of each LineItem. Right now no value changes inside the bean. Is it possible to do that? Thanks a lot for your help. Matthias __ 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]
Error creating form bean
Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error creating form bean
Attention Todd Thorner! :-) It look like you had very similar problem, but I saw no replies to your post. Did you ever get this fixed: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html I'm working under an extreme deadline, please help :-( - Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error creating form bean
Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Regards, David -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 7:22 PM To: Struts Users Mailing List Subject: Re: Error creating form bean Attention Todd Thorner! :-) It look like you had very similar problem, but I saw no replies to your post. Did you ever get this fixed: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html I'm working under an extreme deadline, please help :-( - Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - 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]
Drop-Down List - Cannot Retrieve Definition From Form Bean Null
My drop-down list got an error message: org.apache.jasper.JasperException: Cannot retrieve definition for form bean null I have tried to display the drop-down list in two ways: First: html:select size=1 property=editor multiple=false html:options collection=editors property=name labelProperty=name/ /html:select Second: bean:define id=editorsList name=editors scope=session / html:select property=editor size=1 multiple=false html:options collection=editorsList labelProperty=name property=value/ /html:select The editors is a Collection of EditorBean passed to the JSP this way: HttpSession session = request.getSession(); session.setAttribute( editors, editors ); and Editor Bean is: public class EditorBean { private String name; public EditorBean() {} public EditorBean( String name ) { this.name = name; } public String getName() { return name; } public void setName( String name ) { this.name = name; } } __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error creating form bean
Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Yep. WEB-INF/classes/com/ponyprinting/web/manager/forms/UploadForm.class ...just to be precise. Thanks, -Sasha On 12/1/03 6:27 PM, David Friedman [EMAIL PROTECTED] wrote: Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Regards, David -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 7:22 PM To: Struts Users Mailing List Subject: Re: Error creating form bean Attention Todd Thorner! :-) It look like you had very similar problem, but I saw no replies to your post. Did you ever get this fixed: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html I'm working under an extreme deadline, please help :-( - Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - 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: Error creating form bean
And I think you just found my problem - it was a small typo: In struts-config, I had: type=com.ponyprinting.web.manager.UploadForm / Instead of: type=com.ponyprinting.web.manager.forms.UploadForm / Thanks a lot David! Sorry to bother the list with such a stupid mistake. But when you've been looking at something for 15 hours... -Sasha On 12/1/03 6:38 PM, Sasha Borodin [EMAIL PROTECTED] wrote: Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Yep. WEB-INF/classes/com/ponyprinting/web/manager/forms/UploadForm.class ...just to be precise. Thanks, -Sasha On 12/1/03 6:27 PM, David Friedman [EMAIL PROTECTED] wrote: Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Regards, David -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 7:22 PM To: Struts Users Mailing List Subject: Re: Error creating form bean Attention Todd Thorner! :-) It look like you had very similar problem, but I saw no replies to your post. Did you ever get this fixed: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html I'm working under an extreme deadline, please help :-( - Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error creating form bean
Yep. That was the first thing I noticed when I read your email after dinner: 'form' :) Regards, David -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 7:45 PM To: Struts Users Mailing List Subject: Re: Error creating form bean And I think you just found my problem - it was a small typo: In struts-config, I had: type=com.ponyprinting.web.manager.UploadForm / Instead of: type=com.ponyprinting.web.manager.forms.UploadForm / Thanks a lot David! Sorry to bother the list with such a stupid mistake. But when you've been looking at something for 15 hours... -Sasha On 12/1/03 6:38 PM, Sasha Borodin [EMAIL PROTECTED] wrote: Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Yep. WEB-INF/classes/com/ponyprinting/web/manager/forms/UploadForm.class ...just to be precise. Thanks, -Sasha On 12/1/03 6:27 PM, David Friedman [EMAIL PROTECTED] wrote: Just to be explicit, you have a file in tomcat as: WEB-INF/classes/com/ponyprinting/web/manager/UploadForm.class ? Regards, David -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 7:22 PM To: Struts Users Mailing List Subject: Re: Error creating form bean Attention Todd Thorner! :-) It look like you had very similar problem, but I saw no replies to your post. Did you ever get this fixed: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86103.html I'm working under an extreme deadline, please help :-( - Howdy, I'm having a bizarre problem with a new ActionForm I've just created: when I hit a jsp that uses this form, the RequestUtils say there's an error creating form bean of my class. 2003-12-01 17:01:33,432 [Thread-2] ERROR org.apache.struts.util.RequestUtils Error creating form bean of class com.ponyprinting.web.manager.UploadForm java.lang.ClassNotFoundException: com.ponyprinting.web.manager.UploadForm The class file is there (I checked the build directory that tomcat's being pointed to for docBase of my web app). And it obviously compiled fine. Sigh. It's the little problems that take up 80% of the time :-( Please help! Thank you, -Sasha Borodin - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Drop-Down List - Cannot Retrieve Definition From Form Bean Null
Hi Caroline, The list should not be a session attribute. Instead, you should declare member variables inside your Form bean as follows.. public class EditorForm { String [] options; EditorBean editor; public String [] getOptions() { return options; } public EditorBean getEditor() { return this.editor; } } In your JSP page, html:select property=editor html:options property=options / /html:select Hope this helps you... Ajay My drop-down list got an error message: org.apache.jasper.JasperException: Cannot retrieve definition for form bean null I have tried to display the drop-down list in two ways: First: html:select size=1 property=editor multiple=false html:options collection=editors property=name labelProperty=name/ /html:select Second: bean:define id=editorsList name=editors scope=session / html:select property=editor size=1 multiple=false html:options collection=editorsList labelProperty=name property=value/ /html:select The editors is a Collection of EditorBean passed to the JSP this way: HttpSession session = request.getSession(); session.setAttribute( editors, editors ); and Editor Bean is: public class EditorBean { private String name; public EditorBean() {} public EditorBean( String name ) { this.name = name; } public String getName() { return name; } public void setName( String name ) { this.name = name; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Getting ArrayList of objects from my form bean into my drop down list - solution
Just in case some other newbies are doing the same thing, this was my solution: html:select property=projCodeName bean:define id=codes name=projectForm property=projCodeNames/ html:options collection=codes property=name labelProperty=name/ /html:select Its making a new bean on the .jsp page with my ArrayList that was in my form bean, and then I can easily get the values from it. (I can't wait until this stuff is all second nature! I haven't even started doing anything difficult yet!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Getting ArrayList of objects from my form bean into my drop down list - solution
What a good timing to see this post. I was about to do the same thing in the next day or two. I have an ArrayList of JavaBean objects created from accessing the database: while(rs.next()) { editorBean=new EditorBean(rs.getString(user_name)); editors.add(editorBean); } return editors; Obviously, each EditorBean object is the value of the user_name. If I have this request.setAttribute( EDITORS, editors ); How do I create a drop-down list? Please comment the way I tend to code: html:select property=editors multiple=false bean:define id=EDITORS name=?? property=editors/ html:options collection=EDITORS property=? labelProperty=??/ /html:select What should I do with those places I marked with the question marks (?) --- Janice [EMAIL PROTECTED] wrote: Just in case some other newbies are doing the same thing, this was my solution: html:select property=projCodeName bean:define id=codes name=projectForm property=projCodeNames/ html:options collection=codes property=name labelProperty=name/ /html:select Its making a new bean on the .jsp page with my ArrayList that was in my form bean, and then I can easily get the values from it. (I can't wait until this stuff is all second nature! I haven't even started doing anything difficult yet!) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Getting ArrayList of objects from my form bean into my drop down list
Hi, I am working on getting a drop-down list of values that are generated from a DB call to show up on my page, both before and after validating the page. It was working earlier, when I was just making a nice ArrayList of my objects and adding the list to the session. (It looked to me like it had to be in the session, since the request lost the ArrayList after validate().) That didn't seem like the best plan, so I tried to make my list part of my DynaValidatorForm. (Now if you all say that its perfectly fine to add the ArrayList of options to the session, I'll take your word for it and stop there.) So, then I changed my form to add the ArrayList like such: form-bean name=projectForm type=org.apache.struts.validator.DynaValidatorForm form-property name=nametype=java.lang.String / form-property name=description type=java.lang.String / form-property name=weight type=java.lang.String / form-property name=active type=java.lang.String / form-property name=projCodeName type=java.lang.String / form-property name=projCodeNames type=java.util.ArrayList/. /form-bean The objects that are in the ArrayList are beans that have a few attributes. So in my .jsp, I've got: html:select property=projCodeName html:options property=projCodeNames / /html:select This started out being pretty ugly. It looked like it was calling toString() on my bean. I added a toString() method and then that's what I got back, as both my option's value and label. I suppose this makes sense, since I haven't told it which attributes to put out for either. The problem is, I don't see how to specify which attributes to use. I've read and re-read: http://jakarta.apache.org/struts/userGuide/struts-html.html#options and I guess I'm missing something, because I couldn't find the answer there. I suppose this would work if my ArrayList contained nothing but Strings. But then how would I get my value and label to be different? It appears that I would need to have two collections: one for the labels and one for the values. As I'm learning struts, it seems like there's lots of slick ways to do things, and having 2 collections of Strings doesn't seem very slick. So I'm assuming I'm missing something. Could someone please clue me in as to what I'm doing wrong or not understanding? Thanks in advance, Janice (Victoria, BC) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Definition for form bean
Hi, I am getting [ org.apache.jasper.JasperException: Cannot retrieve definition for form bean null ] but I have given it in my struts-config.xml [ form-beans form-bean name=loginForm type=com.globalRad.LoginForm/ /form-beans ] the class LoginForm.class exists in the specified directory structure... Where can I be going wrong? Pls advice. Thanks! Ipsita -- http://www.fastmail.fm - mmm... Fastmail... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Definition for form bean
Can you please send the code of your action mapping also. AS i think u may be using attribute not the name while associating the form with the Action. - Original Message - From: Ipsita [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 13, 2003 2:21 PM Subject: Definition for form bean Hi, I am getting [ org.apache.jasper.JasperException: Cannot retrieve definition for form bean null ] but I have given it in my struts-config.xml [ form-beans form-bean name=loginForm type=com.globalRad.LoginForm/ /form-beans ] the class LoginForm.class exists in the specified directory structure... Where can I be going wrong? Pls advice. Thanks! Ipsita -- http://www.fastmail.fm - mmm... Fastmail... - 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: Definition for form bean
Hi Ipsita, Have a look at the following ex: form-bean name=TestFormBean type=test.FormBeanClass/ action path=/test type=test.ActionClass scope=session name=TestFormBean validate=true forward name=Success path=/jsp/displaypage.jsp redirect=false/ forward name=Failure path=/jsp/error.jsp redirect=false/ /action The problem would be at the ActionMapping where you are associating the formBean with the Action Class. If you have done that already, you can have a quick check in the jsp whether the form bean instance is available or not by : logic:present name=TestFormBean scope=session BForm ref available in Session Scope /B /logic:present if the form bean is available then do the rest of your processing. - Prasun -Original Message- From: Ipsita [mailto:[EMAIL PROTECTED] Sent: Thursday, November 13, 2003 2:22 PM To: Struts Users Mailing List Subject: Definition for form bean Hi, I am getting [ org.apache.jasper.JasperException: Cannot retrieve definition for form bean null ] but I have given it in my struts-config.xml [ form-beans form-bean name=loginForm type=com.globalRad.LoginForm/ /form-beans ] the class LoginForm.class exists in the specified directory structure... Where can I be going wrong? Pls advice. Thanks! Ipsita -- http://www.fastmail.fm - mmm... Fastmail... - 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]
dynamic indexed properties in Form bean
I'm having trouble populating a Form bean that has an indexed (variable size) nested bean. I'm using an ArrayList inside the Form bean to collect the nested properties and it's partially working. The problem is that because the index is variable, I don't know how to correctly size the ArrayList. As a result, the nested beans are being accessed by their index inconsistently.I'm trying to dynamically grow it as getBean(int idx) is called, but it's messy. Does anyone have a good solution for this? Thanks in advance. JSP: c:forEach var='borrowerLiability' items='${LiabilityForm.borrowerLiability}' varStatus='idx' tr html:hidden indexed='true' name='borrowerLiability' property='liabilityId' / td class=input input type=checkbox name=omit/ /td td class=input html:select indexed='true' name='borrowerLiability' property='borrowerId' html-el:optionsCollection name='property' property='borrowers' label='canonicalName' value='id' / /html:select /td td class=input html:select indexed='true' name='borrowerLiability' property='liabilityTypeId' html:options collection='%=ContextKey.LIABILITY_TYPES%' property='id' labelProperty='name' //option /html:select /td td class=inputhtml:text indexed='true' name='borrowerLiability' property='payment' size='7' //td td class=input html:select indexed='true' name='borrowerLiability' property='timeIntervalId' html:options collection='%=ContextKey.TIME_INTERVAL_TYPES%' property='id' labelProperty='name' / /html:select /td td class=inputhtml:text indexed='true' name='borrowerLiability' property='balance' size='7' //td /tr /c:forEach Bean fragment: public class LiabilityForm extends ValidatorForm implements MonthlyDebts, DispatchForm { private ArrayList borrowerLiability = new ArrayList(); ... more properties... public BorrowerLiability[] getBorrowerLiability() { return (BorrowerLiability[]) this.borrowerLiability.toArray(new BorrowerLiability[0]); } public BorrowerLiabilityImpl getBorrowerLiability(int idx) { BorrowerLiabilityImpl bl; if (borrowerLiability.size() = idx) { borrowerLiability.ensureCapacity(idx+1); bl = new BorrowerLiabilityImpl(); borrowerLiability.add(bl); } else bl = (BorrowerLiabilityImpl) borrowerLiability.get(idx); return bl; } ...more method ... } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic indexed properties in Form bean
search the user archive..This has been answered many times before.. The solution is use lazyList implementation by struts or Dynamic arryList as implemented in my Solution..(See in the list archive)..I think that is what u have also said u tried..And it works..I have also answered thsi question a couple of times.. Still if u cant get it to work or have doubt, repost the question :-)) HTH. regards, Shirish -Original Message- From: Marc Dugger [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 4:56 PM To: [EMAIL PROTECTED] Subject: dynamic indexed properties in Form bean I'm having trouble populating a Form bean that has an indexed (variable size) nested bean. I'm using an ArrayList inside the Form bean to collect the nested properties and it's partially working. The problem is that because the index is variable, I don't know how to correctly size the ArrayList. As a result, the nested beans are being accessed by their index inconsistently.I'm trying to dynamically grow it as getBean(int idx) is called, but it's messy. Does anyone have a good solution for this? Thanks in advance. JSP: c:forEach var='borrowerLiability' items='${LiabilityForm.borrowerLiability}' varStatus='idx' tr html:hidden indexed='true' name='borrowerLiability' property='liabilityId' / td class=input input type=checkbox name=omit/ /td td class=input html:select indexed='true' name='borrowerLiability' property='borrowerId' html-el:optionsCollection name='property' property='borrowers' label='canonicalName' value='id' / /html:select /td td class=input html:select indexed='true' name='borrowerLiability' property='liabilityTypeId' html:options collection='%=ContextKey.LIABILITY_TYPES%' property='id' labelProperty='name' //option /html:select /td td class=inputhtml:text indexed='true' name='borrowerLiability' property='payment' size='7' //td td class=input html:select indexed='true' name='borrowerLiability' property='timeIntervalId' html:options collection='%=ContextKey.TIME_INTERVAL_TYPES%' property='id' labelProperty='name' / /html:select /td td class=inputhtml:text indexed='true' name='borrowerLiability' property='balance' size='7' //td /tr /c:forEach Bean fragment: public class LiabilityForm extends ValidatorForm implements MonthlyDebts, DispatchForm { private ArrayList borrowerLiability = new ArrayList(); ... more properties... public BorrowerLiability[] getBorrowerLiability() { return (BorrowerLiability[]) this.borrowerLiability.toArray(new BorrowerLiability[0]); } public BorrowerLiabilityImpl getBorrowerLiability(int idx) { BorrowerLiabilityImpl bl; if (borrowerLiability.size() = idx) { borrowerLiability.ensureCapacity(idx+1); bl = new BorrowerLiabilityImpl(); borrowerLiability.add(bl); } else bl = (BorrowerLiabilityImpl) borrowerLiability.get(idx); return bl; } ...more method ... } - 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]
Generic form bean in session
Hello all, We are planning to use a generic form bean for all forms. When two browser windows are open with different forms, and the form is submitted, there is a chance for the values in form bean from one form to be dumped into the form bean into the other form. Is there a standard way to resolve this issue. I checked the saveToken() and isTokenValid() method, but I dont feel this will help. Please let me know if there is any standard way or work around to resolve this issue. Regards, Vijay Sargunam Icicle Consultancy, Web: www.icicleconsultancy.com
Re: How to populate form bean during runtime from an XML file?
On Fri, 7 Nov 2003, Jyothi Panduranga wrote: Hi, Are there any third party libraries to populate Form bean during run time from and XML file? Can somebody give me pointers on how to go about doing this? Has anybody done this before? Any help would be appreciated. Take a look at the DigestingPlugin for easy xml to bean population at startup: http://demo.jgsullivan.com/struts/DigestingPlugIn.html Thanks in advance, Jyothi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James Mitchell Software Developer / Struts Evangelist http://www.struts-atlanta.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to populate form bean during runtime from an XML file?
Hi, Are there any third party libraries to populate Form bean during run time from and XML file? Can somebody give me pointers on how to go about doing this? Has anybody done this before? Any help would be appreciated. Thanks in advance, Jyothi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to populate form bean during runtime from an XML file?
Jyothi Panduranga wrote: Are there any third party libraries to populate Form bean during run time from and XML file? Can somebody give me pointers on how to go about doing this? Can you give more details? Are you talking about pre-populating the Form, like presenting an existing record for editing? I would probably populate some other object (Data Transfer Object, JavaBean, whatever) from the XML and then continue using BeanUtils.copyProperties() to populate the Form bean. I have not played with it, but I think there's a project in the Commons that can populate a Java Object from XML. Is it Digester?? I would keep this sort of thing outside of the Struts code, the Actions don't need to know where the data is coming from, they just get a DataAccessObject of some sort and tell it to go get some data. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:equal using form bean property?
Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com
Re: logic:equal using form bean property?
If you're using a Servlet 2.3 container you should use the JSTL's c:forEach and c:if tags instead of the Struts tags. What do your getter and setter method for pid look like? David --- Greg Hess [EMAIL PROTECTED] wrote: Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com http://www.wrappedapps.com __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:equal using form bean property?
My container is Resin 2.1.10 supporting Servlet 2.3, but have not yet played with any JSTL tag's will convert as a last resort. The method signatures are as follows: public void setPid(String id) { m_pid = id; } public String getPid() { return m_pid; } Thanks, Greg -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:23 AM To: Struts Users Mailing List Subject: Re: logic:equal using form bean property? If you're using a Servlet 2.3 container you should use the JSTL's c:forEach and c:if tags instead of the Struts tags. What do your getter and setter method for pid look like? David --- Greg Hess [EMAIL PROTECTED] wrote: Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com http://www.wrappedapps.com __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - 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]
Date form bean property
I have question about using Date object property in form bean. Is using other type than String or int possible? I want to have setter method which parses String to Date and a getter method which returns Date object. tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with form bean [urgent]
Hello john, I used to use this method, but the problem was that this way I am you unable to retain the state of the form in case of validate() method returning a false. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 12:23 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Help with form bean [urgent] For your drop-down: select name=country logic:iterate id=countries name=yourArrayList scope=request option value=bean:write name=countries /bean:write name=countries //option /logic:iterate /select Let me know if you need more help. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 1:15 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Help with form bean [urgent] Ok, yet another attempt to explain my problem. Say I have a registration form and I have the list of countries stored in an ArrayList with each element as a key, value pair (Map). Now when I call the registration form. The actionForm for the the registration form has one field country (with both the getter and setter). How do I write the bean tag, so that the ArrayList (which is placed in the request scope already) is taken to render a dropdown menu of countries and the value of the selected item goes into the countryId property of the registration ActionForm. If ur still with me so far, then yet another question, how do do the same in case I want to user to select the countries from a checkbox (could be possibly multiple countries) if possible please give me a sample code to learn as well. My project deadline is coming close and I am stuck with conceptual problems. Please consider this as urgent call for help. Thanks in advance. Rajat Pandit | [EMAIL PROTECTED] +91 612 3117606 [ Developer and Part Time Human Being] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with form bean [urgent]
Ok, yet another attempt to explain my problem. Say I have a registration form and I have the list of countries stored in an ArrayList with each element as a key, value pair (Map). Now when I call the registration form. The actionForm for the the registration form has one field country (with both the getter and setter). How do I write the bean tag, so that the ArrayList (which is placed in the request scope already) is taken to render a dropdown menu of countries and the value of the selected item goes into the countryId property of the registration ActionForm. If ur still with me so far, then yet another question, how do do the same in case I want to user to select the countries from a checkbox (could be possibly multiple countries) if possible please give me a sample code to learn as well. My project deadline is coming close and I am stuck with conceptual problems. Please consider this as urgent call for help. Thanks in advance. Rajat Pandit | [EMAIL PROTECTED] +91 612 3117606 [ Developer and Part Time Human Being] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with form bean [urgent]
BDY.RTF Description: RTF file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with form bean [urgent]
You wrote: My project deadline is coming close and I am stuck with conceptual problems. Please consider this as urgent call for help. Thanks in advance. Rajat, Greetings. Just curious, what is your project for? Are you doing work for Motorola? Take it easy! Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with form bean [urgent]
Oops! Message intended only for Rajat! Oh well -- hopefully one of us will be able to help him with the problem he's having. Have a great day. Andy --- Andy Engle [EMAIL PROTECTED] wrote: You wrote: My project deadline is coming close and I am stuck with conceptual problems. Please consider this as urgent call for help. Thanks in advance. Rajat, Greetings. Just curious, what is your project for? Are you doing work for Motorola? Take it easy! Andy - 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: Help with form bean [urgent]
If you've set the Map up in you Action, something like this: Map countries = new HashMap(); countries.put(AF, Afghanistan); countries.put(AL, Albania); countries.put(DZ, Algeria); countries.put(AS, American Samoa); countries.put(AD, Andorra); countries.put(AO, Angola); countries.put(AI, Anguilla); countries.put(AQ, Antarctica); request.setAttribute(countries, countries); You can generate the list in your JSP using: html:select property=countryId html:options collection=countries property=key labelProperty=value / /html:select 'countryId' is the name of the property in your ActionForm 'countries' is the request scope attribute name where you stored the Map. You would probably want to load the list from a properties file or database and since these values don't change very often, you could do this once at startup and place the Map in application scope rather than in the request. To generate checkboxes, use something like this: logic:iterate name=countries id=country html:multibox property=countryIds name=countries bean:write name=country property=key/ /html:multibox bean:write name=country property=value/br/ /logic:iterate Your form property must be a String array to receive multiple values. Steve p.s. Please don't put 'urgent' in your subject line. It may not achieve the effects you desire ;-) -Original Message- From: Rajat Pandit [mailto:[EMAIL PROTECTED] Sent: October 20, 2003 12:15 PM To: 'Struts Users Mailing List' Subject: Help with form bean [urgent] Ok, yet another attempt to explain my problem. Say I have a registration form and I have the list of countries stored in an ArrayList with each element as a key, value pair (Map). Now when I call the registration form. The actionForm for the the registration form has one field country (with both the getter and setter). How do I write the bean tag, so that the ArrayList (which is placed in the request scope already) is taken to render a dropdown menu of countries and the value of the selected item goes into the countryId property of the registration ActionForm. If ur still with me so far, then yet another question, how do do the same in case I want to user to select the countries from a checkbox (could be possibly multiple countries) if possible please give me a sample code to learn as well. My project deadline is coming close and I am stuck with conceptual problems. Please consider this as urgent call for help. Thanks in advance. Rajat Pandit | [EMAIL PROTECTED] +91 612 3117606 [ Developer and Part Time Human Being] - 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: Cannot retrieve definition for form bean null
hi! i have defined a form KioskForm, that i am using later in the application. since my current form consists only of a submit button and no fields, html:form action=/kiosk browse kiosks html:submit value=Submit//html:form can i define kioskForm in the action mapping as the form for this empty form? what i am trying to do is just test struts forms on my server. i have been having problems with it not matching my requests to the appropriate action class. thanks cheers ajay From: Max Cooper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Cannot retrieve definition for form bean null Date: Tue, 7 Oct 2003 22:33:54 -0700 Struts is looking for the action form defined for the /kiosk action (since that is what the html:form submits to on your page. The action or action form does not exist, so you get the error of Struts looking for the null action form. Use a regular HTML form tag to evade that issue, or define the stuff for your /kiosk action. -Max - Original Message - From: ajay brar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 9:30 PM Subject: Cannot retrieve definition for form bean null hi! i had heard that a form bean for a form was optional, not sure why i am getting this error here. i have a button on a page and it goes like html:form action=/kiosk browse kiosks html:submit value=Submit//html:form in my struts-config.xml i have defined the following action mapping action path=/kiosk type=KioskAction scope=request forward name=successpath=/kiosk.jsp / /action could someone please help with this error. thanks cheers ajay _ Chat via SMS. Simply send 'CHAT' to 1889918. More info at http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800 - 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] _ Get less junk mail with ninemsn Premium. Click here http://ninemsn.com.au/premium/landing.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot retrieve definition for form bean null
Hallo, I am looking for mistake and not to see it. I have jsp: %@ taglib uri=/tags/struts-html prefix=html % html:form action=/SaveMenuLang method=post focus=adminMenuLang html:hidden name=adminMenuLang property=langId / html:hidden name=adminMenuLang property=packId / ... /html:form , in my struts-config is: form-bean name=adminMenuLang type=org.apache.struts.action.DynaActionForm form-property name=langId type=java.lang.Integer / form-property name=packId type=java.lang.Integer / form-property name=menuId type=java.lang.Integer / form-property name=menu type=java.lang.String / /form-bean and action path=/PrepareLangMenu name=adminMenuLang scope=request type=cz.chalu.struts.modules.admin.PrepareLangMenuAction forward name=success path=.main.admin.menu.lang / forward name=error path=.main.admin.menu.lang / /action action path=/SaveMenuLang name=adminMenuLang scope=request type=cz.chalu.struts.modules.admin.SaveLangMenuAction forward name=success path=.main.admin.base / forward name=error path=.main.admin.menu.lang / /action in action cotroler: System.out.println(begin ...); LanguageMenusBO bo = new LanguageMenusBO(); LangMenuDTO dto = new LangMenuDTO(); DynaActionForm theForm = (DynaActionForm) form; BeanUtils.copyProperties(dto, theForm ); BeanUtils.copyProperties(theForm, bo.getLangMenu(dto)); request.setAttribute(mapping.getAttribute(), theForm); //request.setAttribute(adminMenuLang, theForm); System.out.println(finish controler ...); return (mapping.findForward(Config.SUCCESS)); and I got exception ... 22:58:26,005 INFO [STDOUT] finish controler ... 22:58:27,603 ERROR [Engine] ApplicationDispatcher[/cms] Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Cannot retrieve definition for form bean null at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) Does anybody see what I am not? I looking at this too long and do not see anything :( when I delete form tags html:form ... and /html:form and leave body of form, this message I do not get and hidden inputs are filled correctly as all others. Thanks, Jiri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot retrieve definition for form bean null
Hi, I got the above error when I ran my struts app. I am not using a form for this action since I only need to diaply it. And I am using Tiles framework for this. Appreciate any help. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot retrieve definition for form bean null
Is it absolutely necessary to use a form bean for every action? I will only let user to click on a link and forward it to another page while sending a value. Should I define a form bean for this? And how can I do it? regards, --- victor gusz [EMAIL PROTECTED] wrote: Hi, I got the above error when I ran my struts app. I am not using a form for this action since I only need to diaply it. And I am using Tiles framework for this. Appreciate any help. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot retrieve definition for form bean null
hi! i had heard that a form bean for a form was optional, not sure why i am getting this error here. i have a button on a page and it goes like html:form action=/kiosk browse kiosks html:submit value=Submit//html:form in my struts-config.xml i have defined the following action mapping action path=/kiosk type=KioskAction scope=request forward name=successpath=/kiosk.jsp / /action could someone please help with this error. thanks cheers ajay _ Chat via SMS. Simply send 'CHAT' to 1889918. More info at http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot retrieve definition for form bean null
If you don't define a form in the struts config file how can you expect the form tag to work correctly? It's whole purpose is to reference the form attribute in your config and then reference the corresponding form in the request. Use the standard html form tag when you don't define a form for your action (form). On Tue, 2003-10-07 at 23:30, ajay brar wrote: hi! i had heard that a form bean for a form was optional, not sure why i am getting this error here. i have a button on a page and it goes like html:form action=/kiosk browse kiosks html:submit value=Submit//html:form in my struts-config.xml i have defined the following action mapping action path=/kiosk type=KioskAction scope=request forward name=successpath=/kiosk.jsp / /action could someone please help with this error. thanks cheers ajay _ Chat via SMS. Simply send 'CHAT' to 1889918. More info at http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800 - 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: Cannot retrieve definition for form bean null
Struts is looking for the action form defined for the /kiosk action (since that is what the html:form submits to on your page. The action or action form does not exist, so you get the error of Struts looking for the null action form. Use a regular HTML form tag to evade that issue, or define the stuff for your /kiosk action. -Max - Original Message - From: ajay brar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 9:30 PM Subject: Cannot retrieve definition for form bean null hi! i had heard that a form bean for a form was optional, not sure why i am getting this error here. i have a button on a page and it goes like html:form action=/kiosk browse kiosks html:submit value=Submit//html:form in my struts-config.xml i have defined the following action mapping action path=/kiosk type=KioskAction scope=request forward name=successpath=/kiosk.jsp / /action could someone please help with this error. thanks cheers ajay _ Chat via SMS. Simply send 'CHAT' to 1889918. More info at http://ninemsn.com.au/mobilemania/MoChat.asp?blipid=6800 - 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]
Initializing Form bean values in jsp
Hi, I am trying to avoid duplicating the same form for the sake of two radio buttons. I call (no actions) the following: mypage.jsp?type=1; or mypage.jsp?type=2; I can determine which parameter value is passed using: bean:parameter id=idType name=type value=type not found/ bean:write name=idType/ The 1 or 2 is printed depending which jsp (above) is called. You can view 1 as representing form 1 and 2 representing form 2. Next I want to set the appropriate radio button based on this value. I am using DynaValidatorForm in this case (initializing in the struts-config won't work). I can get the Formbean in my jsp using: bean:struts id=myForm formBean=myDynaForm/ NOW WHAT I DON'T KNOW HOW TO DO IS INITIALIZE THE my radio so it is displayed as selected. html-el:radio property=myradio value=state1/ html-el:radio property=myradio value=state2/ AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK. IS THIS POSSILBE DO I HAVE THE HOOKS ABOVE TO DO THIS? thanks, Barry
Initializing Form bean values in jsp
Hi, I am trying to avoid duplicating the same form for the sake of two radio buttons. I call (no actions) the following: mypage.jsp?type=1; or mypage.jsp?type=2; I can determine which parameter value is passed using: bean:parameter id=idType name=type value=type not found/ bean:write name=idType/ The 1 or 2 is printed depending which jsp (above) is called. You can view 1 as representing form 1 and 2 representing form 2. Next I want to set the appropriate radio button based on this value. I am using DynaValidatorForm in this case (initializing in the struts-config won't work). I can get the Formbean in my jsp using: bean:struts id=myForm formBean=myDynaForm/ NOW WHAT I DON'T KNOW HOW TO DO IS INITIALIZE THE my radio so it is displayed as selected. html-el:radio property=myradio value=state1/ html-el:radio property=myradio value=state2/ AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK. IS THIS POSSILBE DO I HAVE THE HOOKS ABOVE TO DO THIS? thanks, Barry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ANY TAKERS?? Initializing Form bean values in jsp
Hi, I am trying to avoid duplicating the same form for the sake of two radio buttons. I call (no actions) the following: mypage.jsp?type=1; or mypage.jsp?type=2; I can determine which parameter value is passed using: bean:parameter id=idType name=type value=type not found/ bean:write name=idType/ The 1 or 2 is printed depending which jsp (above) is called. You can view 1 as representing form 1 and 2 representing form 2. Next I want to set the appropriate radio button based on this value. I am using DynaValidatorForm in this case (initializing in the struts-config won't work). I can get the Formbean in my jsp using: bean:struts id=myForm formBean=myDynaForm/ NOW WHAT I DON'T KNOW HOW TO DO IS INITIALIZE THE my radio so it is displayed as selected. html-el:radio property=myradio value=state1/ html-el:radio property=myradio value=state2/ AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK. IS THIS POSSILBE DO I HAVE THE HOOKS ABOVE TO DO THIS? thanks, Barry - 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: ANY TAKERS?? Initializing Form bean values in jsp
AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK. No need to yell... But you have to understand that this it not the Struts Way. Many of us put JSP's under WEB-INF or behind a security constraint specifically to FORCE users to go through an action. Life's just better that way. I'm not sure what the issue is. If you insist on doing stuff in the JSP, you have access to the 'request' object. Do some conditional tags (c:if or c:choose c:when ) or even {shudder} a scriptlet based on the results of request.getParameter(type); . You may end up doing plain-old input type=radio for these. There's no rule that says you *have* to use the Struts tags. In this case, I see three choices-- type=1 , write out the radio tags with the first one selected type=2 , write out the radio tags with the second one selected type not present in request, use the Struts tag -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ANY TAKERS?? Initializing Form bean values in jsp
Hi Wendy, Thanks for responding. I have gotten closer to what I want to accomplish but not quite. To give you a little background. I have a menu with an action that has multiple fowards to simple select several jsp pages. That works fine. Two of the selections use the same form. So the same form will be displayed with the two selections. The only difference is I want one page to come up with one radio button selected and when the other form is displayed the other radio button is selected. The action is very simple it just fowards to the required jsp. I have come up with the following but it does not select the desired radio button. mypage.jsp?formOption=center mypage.jsp?formOption=home bean:parameter id=options name=formOption value=type not found/ Results: bean:write name=options/ This first part (above) works fine the following is what I am still trying to work out: jsp:useBean id=myformbean class=com.forms.myForm/ jsp:setProperty name=myformbean property=type value=center / The property does get set but the radio button does not get set. bean:write name=myformbean property=type/ will display center which is fine Now here is the radio buttons: html-el:radio property=type value=center/ html-el:radio property=type value=home/ At runtime I would want center to be checked. input type=radio name=type value=center checked=checked Set property does set the form bean property to center (value=center above) but it does not set the form radio button. So in summary all I really want to do here is call a jsp page directly and set a radio button as selected. Barry - Original Message - From: Wendy Smoak [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, October 03, 2003 4:30 PM Subject: RE: ANY TAKERS?? Initializing Form bean values in jsp AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK. No need to yell... But you have to understand that this it not the Struts Way. Many of us put JSP's under WEB-INF or behind a security constraint specifically to FORCE users to go through an action. Life's just better that way. I'm not sure what the issue is. If you insist on doing stuff in the JSP, you have access to the 'request' object. Do some conditional tags (c:if or c:choose c:when ) or even {shudder} a scriptlet based on the results of request.getParameter(type); . You may end up doing plain-old input type=radio for these. There's no rule that says you *have* to use the Struts tags. In this case, I see three choices-- type=1 , write out the radio tags with the first one selected type=2 , write out the radio tags with the second one selected type not present in request, use the Struts tag -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - 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]
Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean
Hi, My form bean contains the following get set methods : setRate(String[] rate) { rate = this.rate; } public String[] getRate() { return rate (which is the String[]) } Also one int variable (counter) which stores the no. of elements in the Array. public int counter() { return counter; } public void setCounter(int counter) { counter = this.counter; } How to get these values in the JSP for iterating the String[] counter no. of times... Pls. assist... Thanx for your help. Regards. DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean
You can use the Logic:iterate tag...Inside that you can uye any HTMl tag you want... Also have a look at nested tags ...They will help you. Why are you using the Arry and all this a bit difficult syntax?Why not use a list instead?Then you dont have to keep worrying about setting the counter etc... -Original Message- From: Chawla, Yogesh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 11:46 AM To: 'Struts Users Mailing List' Subject: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean Importance: High Hi, My form bean contains the following get set methods : setRate(String[] rate) { rate = this.rate; } public String[] getRate() { return rate (which is the String[]) } Also one int variable (counter) which stores the no. of elements in the Array. public int counter() { return counter; } public void setCounter(int counter) { counter = this.counter; } How to get these values in the JSP for iterating the String[] counter no. of times... Pls. assist... Thanx for your help. Regards. DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. 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]
RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean
I am using Struts 1.0 and therefore do not have access to nested tags ! String[] as far as I understand is the lightest memory component here, so looking at the performance side, had opted for that one.. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 3:41 PM To: [EMAIL PROTECTED] Subject: RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean You can use the Logic:iterate tag...Inside that you can uye any HTMl tag you want... Also have a look at nested tags ...They will help you. Why are you using the Arry and all this a bit difficult syntax?Why not use a list instead?Then you dont have to keep worrying about setting the counter etc... -Original Message- From: Chawla, Yogesh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 11:46 AM To: 'Struts Users Mailing List' Subject: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean Importance: High Hi, My form bean contains the following get set methods : setRate(String[] rate) { rate = this.rate; } public String[] getRate() { return rate (which is the String[]) } Also one int variable (counter) which stores the no. of elements in the Array. public int counter() { return counter; } public void setCounter(int counter) { counter = this.counter; } How to get these values in the JSP for iterating the String[] counter no. of times... Pls. assist... Thanx for your help. Regards. DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. 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] DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean
How to use the logic.iterate tag in this case - can let me know.. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 3:41 PM To: [EMAIL PROTECTED] Subject: RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean You can use the Logic:iterate tag...Inside that you can uye any HTMl tag you want... Also have a look at nested tags ...They will help you. Why are you using the Arry and all this a bit difficult syntax?Why not use a list instead?Then you dont have to keep worrying about setting the counter etc... -Original Message- From: Chawla, Yogesh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 11:46 AM To: 'Struts Users Mailing List' Subject: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean Importance: High Hi, My form bean contains the following get set methods : setRate(String[] rate) { rate = this.rate; } public String[] getRate() { return rate (which is the String[]) } Also one int variable (counter) which stores the no. of elements in the Array. public int counter() { return counter; } public void setCounter(int counter) { counter = this.counter; } How to get these values in the JSP for iterating the String[] counter no. of times... Pls. assist... Thanx for your help. Regards. DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. 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] DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Urgent help reqd Stuck..!! - Getting a value String[] from a Form Bean
1. setRate() isn't doing a thing. 2. use JSTL to iterate over the array using c:forEach after setting a page-scoped variable containing the array: c:set var='arrayValues' value='${pageScope.request.myForm.rate}'/ tr c:forEach items='$(arrayValues)' var='item' td c:out value='$(item)'/ /td /c:forEach /tr Mark -Original Message- From: Chawla, Yogesh [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 5:46 AM My form bean contains the following get set methods : setRate(String[] rate) { rate = this.rate; } public String[] getRate() { return rate (which is the String[]) } Also one int variable (counter) which stores the no. of elements in the Array. public int counter() { return counter; } public void setCounter(int counter) { counter = this.counter; } How to get these values in the JSP for iterating the String[] counter no. of times... Pls. assist... Thanx for your help. Regards. DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. 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]
RE: stopping resetting of the form bean
You can override processPopulate in the request processor. -Original Message- From: Nisith Dash [mailto:[EMAIL PROTECTED] Sent: Monday, 29 September 2003 13:58 To: [EMAIL PROTECTED] Subject: stopping resetting of the form bean how can i prevent reset method from being called automatically everytime i call the execute method of any action class. Thanks in advance Nisith
RE: stopping resetting of the form bean
I want to unsubscribe from the list. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 11:41 AM To: Struts Users Mailing List Subject: RE: stopping resetting of the form bean You can override processPopulate in the request processor. -Original Message- From: Nisith Dash [mailto:[EMAIL PROTECTED] Sent: Monday, 29 September 2003 13:58 To: [EMAIL PROTECTED] Subject: stopping resetting of the form bean how can i prevent reset method from being called automatically everytime i call the execute method of any action class. Thanks in advance Nisith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stopping resetting of the form bean
Do I look like the list admin? Try reading what it says at the bottom of every post: snip To unsubscribe, e-mail: [EMAIL PROTECTED] /snip -Original Message- From: Nitesh.Gautam [mailto:[EMAIL PROTECTED] Sent: Monday, 29 September 2003 14:19 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: stopping resetting of the form bean I want to unsubscribe from the list. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 11:41 AM To: Struts Users Mailing List Subject: RE: stopping resetting of the form bean You can override processPopulate in the request processor. -Original Message- From: Nisith Dash [mailto:[EMAIL PROTECTED] Sent: Monday, 29 September 2003 13:58 To: [EMAIL PROTECTED] Subject: stopping resetting of the form bean how can i prevent reset method from being called automatically everytime i call the execute method of any action class. Thanks in advance Nisith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stopping resetting of the form bean
Hi Andrew, I 'll be grateful if you could provide me some insight in to the following: I want to submit an action form using a javascript. The action class for this action form has to open a popup window with some results. I am using the following java script in the main struts-jsp file on click of the GO button: var URL= '/rpm/findCompanyCdAction.do?searchcode='+BusinessDivisionForm.ecmPkey.value ; features=alwaysRaised=yes,dependent=yes,menubar=no,toolbar=no,scrollbars=ye s,height=400,width=600; window.open(URL,,features); However i am not getting the BusinessDivisionForm Action Form in the FindCompanyCdAction Action Class. I guess it is beacuse i am not submitting the action form itself in the javascript.But how can i do that and still have the new URL open in a Pop Up window. Any advice or help will be highly appreciated, Nisith 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]
Re: stopping resetting of the form bean
- Original Message - From: Nisith Dash To: [EMAIL PROTECTED] Sent: Monday, September 29, 2003 7:57 AM Subject: stopping resetting of the form bean how can i prevent reset method from being called automatically everytime i call the execute method of any action class. Thanks in advance Nisith -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stopping resetting of the form bean
how can i prevent reset method from being called automatically everytime i call the execute method ofany action class. Thanks in advance Nisith ** Message from InterScan E-Mail VirusWall NT ** ** No virus found in attached file noname.htm ** No virus found in attached file noname.htm NO VIRUS FOUND: SERVER GENERATED MESSAGE * End of message *** 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]
Access to the form bean from jsp?
I need to access the form from my jsp page, but I can't seem to find a way to do this.. I need a name of the form to access but what is the name of the form instance that Struts generate? If I have a form named LoginForm does Struts make an instance called loginForm or does it choose a random name or? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to the form bean from jsp?
* Bjørn T Johansen ([EMAIL PROTECTED]) wrote: I need to access the form from my jsp page, but I can't seem to find a way to do this.. I need a name of the form to access but what is the name of the form instance that Struts generate? If I have a form named LoginForm does Struts make an instance called loginForm or does it choose a random name or? You specify the name when you declare a form bean in struts-config.xml in example: form-bean name=LoginForm type=com.company.forms.LoginForm / In the jsp you can define a variable to point to this form using: bean:define id=myLoginForm name=LoginForm type=com.company.forms.LoginForm / you can then use myLoginForm in any scriptlet. You can also easily extract specific properties: bean:define id=theUsername name=LoginForm property=username/ or you can print them directly: bean:write name=LoginForm property=username/ This is all from memory, so I hope it's correct. Hope this helps, Anders -- Anders Hermansen YoYo Mobile as - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access to the form bean from jsp?
Yes, you are absolutely correct; it uses the name I defined in struts-config, I should have known... Thanks :) BTJ On Sat, 2003-09-27 at 19:11, Anders Hermansen wrote: * Bjørn T Johansen ([EMAIL PROTECTED]) wrote: I need to access the form from my jsp page, but I can't seem to find a way to do this.. I need a name of the form to access but what is the name of the form instance that Struts generate? If I have a form named LoginForm does Struts make an instance called loginForm or does it choose a random name or? You specify the name when you declare a form bean in struts-config.xml in example: form-bean name=LoginForm type=com.company.forms.LoginForm / In the jsp you can define a variable to point to this form using: bean:define id=myLoginForm name=LoginForm type=com.company.forms.LoginForm / you can then use myLoginForm in any scriptlet. You can also easily extract specific properties: bean:define id=theUsername name=LoginForm property=username/ or you can print them directly: bean:write name=LoginForm property=username/ This is all from memory, so I hope it's correct. Hope this helps, Anders -- Anders Hermansen YoYo Mobile as - 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]
Using Form Bean Java Bean....
Hi, Can I use both Form Bean Java Bean inside a html:form? I have ManageProfileBean(java bean) which has availRoles and ManageProfileForm(Form bean) which has securityRoles. I need to iterate through availRoles and display it as checkbox. When the user selects one or more check boxes the data should get populated in the securityRoles of the form bean. I am trying to use the following code: html:form action=/manageProfile td class=tr_headerSecurity Roles/td logic:present name=availRoles logic:iterate name=availRoles id=roles type=com.qwest.omt.bean.ManageProfileBean.availRoles td html:checkbox name=securityRoles property=key/ bean:write name=roles property=value/br /logic:iterate /td /logic:present In the following code, I am trying to use availDepts from the ManageProfileBean(Java Bean) and department from the ManageProfileForm(Form Bean). logic:present name=availDepts logic:iterate name=availDepts id=dt td html:select property=department html:option value=key bean:write name=dt property=value /html:option /html:select /logic:iterate /td /logic:present Is it a correct? I appreciate your suggesions. Thanks, Srini - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using Form Bean Java Bean....
I have a DynaActionForm that has several DTO's in an Array: form-bean name=locationListForm dynamic=false type=org.apache.struts.validator.DynaValidatorForm form-property name=userLocations type=com.baselogic.yoursos.location.LocationDto[] / form-property name=locationId type=java.lang.String / form-property name=cellColor type=java.lang.String initial=content_tbl_white / /form-bean Works great. --- Thanks Mick Knutson http://www.baselogic.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - Original Message - From: Rajanala, Srinivas [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 4:04 PM Subject: Using Form Bean Java Bean Hi, Can I use both Form Bean Java Bean inside a html:form? I have ManageProfileBean(java bean) which has availRoles and ManageProfileForm(Form bean) which has securityRoles. I need to iterate through availRoles and display it as checkbox. When the user selects one or more check boxes the data should get populated in the securityRoles of the form bean. I am trying to use the following code: html:form action=/manageProfile td class=tr_headerSecurity Roles/td logic:present name=availRoles logic:iterate name=availRoles id=roles type=com.qwest.omt.bean.ManageProfileBean.availRoles td html:checkbox name=securityRoles property=key/ bean:write name=roles property=value/br /logic:iterate /td /logic:present In the following code, I am trying to use availDepts from the ManageProfileBean(Java Bean) and department from the ManageProfileForm(Form Bean). logic:present name=availDepts logic:iterate name=availDepts id=dt td html:select property=department html:option value=key bean:write name=dt property=value /html:option /html:select /logic:iterate /td /logic:present Is it a correct? I appreciate your suggesions. Thanks, Srini - 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]
bizzare indexed form bean problem
i have a form with an indexed property. i wasn't able to get any data out of the form. i could see the data in the request parameters, but the data wasn't in the form bean. in an effort to diagnose, i made an action to populate data into the form. not only was i able to populate data into the form, but suddenly data started showing up in the form bean after the submit. now i can't take the action away! when i do, all the properties of all the beans in the indexed property of the form bean are null. help! what's going on?! -- mike FROM STRUTS-CONFIG.XML: form-bean name=shipmentFormBean type=org.apache.struts.action.DynaActionForm form-property name=action type=java.lang.String / form-property name=shipments type=com.interactivate.cachandler.ShipmentFormBean[] size=12 / /form-bean action path=/data-upload/Shipments forward=shipments.page validate=false roles=data-upl / !-- action path=/data-upload/Shipments type=com.interactivate.cachandler.Foo name=shipmentFormBean scope=session validate=false roles=data-upl forward name=success path=shipments.page / /action -- action path=/data-upload/SubmitShipments type=com.interactivate.cachandler.SubmitShipmentsAction name=shipmentFormBean scope=session validate=false roles=data-upl / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bizzare indexed form bean problem
more info: it turns out that the data i was seeing in the form bean was the data that i pre-populated -- data from the form is NOT making in into form bean. or, more accurately, the INDEXED data is not making it into the form bean. the action property is getting set properly. does anyone have any clues? troubleshooting ideas? -- mike Michael Muller wrote: i have a form with an indexed property. i wasn't able to get any data out of the form. i could see the data in the request parameters, but the data wasn't in the form bean. in an effort to diagnose, i made an action to populate data into the form. not only was i able to populate data into the form, but suddenly data started showing up in the form bean after the submit. now i can't take the action away! when i do, all the properties of all the beans in the indexed property of the form bean are null. help! what's going on?! -- mike FROM STRUTS-CONFIG.XML: form-bean name=shipmentFormBean type=org.apache.struts.action.DynaActionForm form-property name=action type=java.lang.String / form-property name=shipments type=com.interactivate.cachandler.ShipmentFormBean[] size=12 / /form-bean action path=/data-upload/Shipments forward=shipments.page validate=false roles=data-upl / !-- action path=/data-upload/Shipments type=com.interactivate.cachandler.Foo name=shipmentFormBean scope=session validate=false roles=data-upl forward name=success path=shipments.page / /action -- action path=/data-upload/SubmitShipments type=com.interactivate.cachandler.SubmitShipmentsAction name=shipmentFormBean scope=session validate=false roles=data-upl / - 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]
SOLVED: Re: bizzare indexed form bean problem
ok, i think i have it: in the jsp, the id attribute of iterator tag has to match the name of the indexed property of the form bean. -- mike Michael Muller wrote: more info: it turns out that the data i was seeing in the form bean was the data that i pre-populated -- data from the form is NOT making in into form bean. or, more accurately, the INDEXED data is not making it into the form bean. the action property is getting set properly. does anyone have any clues? troubleshooting ideas? -- mike Michael Muller wrote: i have a form with an indexed property. i wasn't able to get any data out of the form. i could see the data in the request parameters, but the data wasn't in the form bean. in an effort to diagnose, i made an action to populate data into the form. not only was i able to populate data into the form, but suddenly data started showing up in the form bean after the submit. now i can't take the action away! when i do, all the properties of all the beans in the indexed property of the form bean are null. help! what's going on?! -- mike FROM STRUTS-CONFIG.XML: form-bean name=shipmentFormBean type=org.apache.struts.action.DynaActionForm form-property name=action type=java.lang.String / form-property name=shipments type=com.interactivate.cachandler.ShipmentFormBean[] size=12 / /form-bean action path=/data-upload/Shipments forward=shipments.page validate=false roles=data-upl / !-- action path=/data-upload/Shipments type=com.interactivate.cachandler.Foo name=shipmentFormBean scope=session validate=false roles=data-upl forward name=success path=shipments.page / /action -- action path=/data-upload/SubmitShipments type=com.interactivate.cachandler.SubmitShipmentsAction name=shipmentFormBean scope=session validate=false roles=data-upl / - 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]
multiple forms with same form bean
hello, my question in one line.. how do u handle multiple forms attached to the same form bean in one bean? longer question -- say i have a list of products and each product has a list of states. i store all the states in an ArrayList and add that as a property of product and then add all the product(s) to the ArrayList productS. now i add this product to the request scope and move the a jsp page which uses logic:iteration to list them. this iteration has a form which will list them. this form is actually a form called bidForm bean. which is printed several times(no. of elements in the bean productS). now i want to use the value of the bean productS in the form bidForm. how do i do that. say productS is iterated with the ID product. and say a particular property called ID and i want to display this in an hidden element for the bean bidForm. html:hidden name=bidForm property=id now i want it to print something liek this input type=hidden name=id' value=whatever was in the product.id my solution for the time being was to type html instead of tags... draw back..they dont retain values..sob sob sob. q2. if ur still with me... yet another question.. linked to the previous problem.. there are now several problems... each form is liked to the form bean bidForm. each form has values frm the productS. i am attaching a screenshot so that u know what i am talking about actually. so when someone fills one form..and there was some error in filling that form..and the page is redisplayed with all the errrors.. all the other forms are also prefilled with the same values as they are attached with the same form bean bidForm. ( i had actually found out a work around for the above problem which was something like this --- snip -- select name=stateId option SELECTED-- bean:message key=app.product.statedefault / --/option logic:iterate id=state name=product property=states option value=bean:write name=state property=id /bean:write name=state property=name //option /logic:iterate /select pretty lame eh!! i know :( -- snip -- and not to forget no state retention so when the error list shows one problem is fixed out of three.. the same problem might persist due to no state retention. regards to all.. reply asap. rajat __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing Parameters to Form Bean on GET's
I'm rewriting a CGI application into Java/Struts so I'm still a newbie at this and am having little luck finding answers/examples to simple things online such as how to pass query string parameters to my form bean in a URL (GET) instead of in a jsp form using struts tags. Basically I'm trying to call an action I defined in a URL. Everything seems to be working fine except that I can't get the params from my query string: URL: /t.do?sId= struts-config.xml: form-bean name=tForm type=packageInfo.TForm / action path = /t type = packageInfo.TAction name = tForm scope = request input = /pages/t.jsp forward name=TStoreSuccess path=/pages/t.jsp / /action TForm.java: private String sId = null; public String getSId() { return sId; } public void setSId(String string) { sId = string; } TAction.java: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //These messages come from the ApplicationResources.properties file MessageResources messages = getResources(request); TForm tForm = (TForm) form; ActionErrors errors = new ActionErrors(); //Check to see if we're storing a url String sId = tForm.getSId(); if (!(sId == null) || !(sId.length() 1)) { //Forward control to the specified success URI return (mapping.findForward(TStoreSuccess)); } else { errors.add(NO_URL, new ActionError(packageInfo.t.NO_URL)); saveErrors(request, errors); return (new ActionForward(mapping.getInput())); } } t.jsp: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true head titlebean:message key=t.jsp.title//title html:base/ /head body bgcolor=whitep html:errors/p logic:present name=packageInfo scope=request h2 bean:message key=t.jsp.stored/!p /h2 /logic:present logic:present name=tForm property=sId bean:write name=sId scope=request/ /logic:present /body /html:html I always get the html:errors even when I pass it the parameter in the URL string. If I hard code private String sId = XXX, I don't get the error, but my logic:present name=tForm property=sId ... /logic:present doesn't seem to evaluate since I don't see the variable get printed out on the page. Can someone please help with how to make this work? Hopefully I'll get the hang of it after this and won't have to ask such basic questions.
Passing Parameters to Form Bean on GET's
I'm rewriting a CGI application into Java/Struts so I'm still a newbie at this and am having little luck finding answers/examples to simple things online such as how to pass query string parameters to my form bean in a URL (GET) instead of in a jsp form using struts tags. Basically I'm trying to call an action I defined in a URL. Everything seems to be working fine except that I can't get the params from my query string: URL: /t.do?sId= struts-config.xml: form-bean name=tForm type=packageInfo.TForm / action path = /t type = packageInfo.TAction name = tForm scope = request input = /pages/t.jsp forward name=TStoreSuccess path=/pages/t.jsp / /action TForm.java: private String sId = null; public String getSId() { return sId; } public void setSId(String string) { sId = string; } TAction.java: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //These messages come from the ApplicationResources.properties file MessageResources messages = getResources(request); TForm tForm = (TForm) form; ActionErrors errors = new ActionErrors(); //Check to see if we're storing a url String sId = tForm.getSId(); if (!(sId == null) || !(sId.length() 1)) { //Forward control to the specified success URI return (mapping.findForward(TStoreSuccess)); } else { errors.add(NO_URL, new ActionError(packageInfo.t.NO_URL)); saveErrors(request, errors); return (new ActionForward(mapping.getInput())); } } t.jsp: %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true head titlebean:message key=t.jsp.title//title html:base/ /head body bgcolor=whitep html:errors/p logic:present name=packageInfo scope=request h2 bean:message key=t.jsp.stored/!p /h2 /logic:present logic:present name=tForm property=sId bean:write name=sId scope=request/ /logic:present /body /html:html I always get the html:errors even when I pass it the parameter in the URL string. If I hard code private String sId = XXX, I don't get the error, but my logic:present name=tForm property=sId ... /logic:present doesn't seem to evaluate since I don't see the variable get printed out on the page. Can someone please help with how to make this work? Hopefully I'll get the hang of it after this and won't have to ask such basic questions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with nested tags and form bean
I have the following scenarion. A form bean with a private member: private LineItem item = null; with appropriate getters and setters. In one of my actions I call setItem and obviously pass it a LineItem object. LineItem is composed of: private Product product; private int quantity; private String productKey; Again with appropriate getters/setters In a JSP I am trying to access the properties of LineItem with the following tag: nested:write name='addToCartForm' property='item.quantity'/ and I keep on getting: [ServletException in:/jsps/shop/productDetailsPage.jsp] Null property value for 'item'' I also tried with: c:out value='${addToCartForm.item.quantity}'/ and in this case nothing printed. I know the form bean is in scope because I tried this: % AddToCartForm form = (AddToCartForm)session.getAttribute(addto.cart.form); if( form == null ){ out.println(The form is null); } else{ out.println(The form is not null); LineItem item = form.getItem(); out.println(item.getQuantity() ); } % and the quantity property printed out this time. If anyone can point me to a solution to this I'd appreciate it. Thanks __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2 Jsp's and 1 form bean using tiles !!!! URGENT HELP
I have the same problem Samip described below. The question posted in this list last year. Nobody replied it. Can you give me some idea on this question. Thanks. Hi Guys, I am using struts and tiles in my project. Here is my problem. I need to put 2 JSP's in the body of one definition of tiles. My definition looks like below: definition name=fda.limitsEnter.body path=/layouts/columnsLayout.jsp put name=numCols value=1 / putList name=list0 add value=/accountCodeList.jsp/ add value=/limitsAdd.jsp/ /putList /definition I am using same form bean for both the JSP's. Now the problem is whenever I submit the form from the second JSP i.e. limitsAdd.jsp in above definition, form bean is not getting populated. How can we resolve this problem? Does tiles support this functionality? Any help will be appreciated. Thanks Samip. Eric (Qin) Zhou - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form Bean Help?
Hello All, I'm running into a little problem, maybe someone can help me fix it. My application is driven by filling out web forms. At one point, A user can click the Save Form button, which writes the form information to a Database. When the user visits the page again, the action builds a DTO that contains all the information they had filled out and puts it in the session scope, then forwards to the JSP page that has the form on it. I had been using the value property of the struts-html tags to fill in the data, but I've noticed that when the user hits submit, if there is a validation error, they are pushed back to the page, and the data they had enetered is replaced with what was in the DTO (which is now old data). I've also run into the problem of filling in things like radio buttons, based on what was in the DTO. It seems to me that what I want to do is not pass along the DTO with the action, but fill out parts of the Form Bean before forwarding to the page that displays it, at which point I could remove the value properties of the html tags, and have everything work. My question is, how can I do this from the action? Or do I want to attack this problem in another way? Thanks! __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form Bean Help?
My angle on this is to only load the data from the database when the user is submitted a request to read data. If they are submitting an update action, I don't load the data from the database. -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:37 PM To: [EMAIL PROTECTED] Subject: Form Bean Help? Hello All, I'm running into a little problem, maybe someone can help me fix it. My application is driven by filling out web forms. At one point, A user can click the Save Form button, which writes the form information to a Database. When the user visits the page again, the action builds a DTO that contains all the information they had filled out and puts it in the session scope, then forwards to the JSP page that has the form on it. I had been using the value property of the struts-html tags to fill in the data, but I've noticed that when the user hits submit, if there is a validation error, they are pushed back to the page, and the data they had enetered is replaced with what was in the DTO (which is now old data). I've also run into the problem of filling in things like radio buttons, based on what was in the DTO. It seems to me that what I want to do is not pass along the DTO with the action, but fill out parts of the Form Bean before forwarding to the page that displays it, at which point I could remove the value properties of the html tags, and have everything work. My question is, how can I do this from the action? Or do I want to attack this problem in another way? Thanks! __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form Bean Help?
Mike, The bean is stored in the Session scope (the bean needs to be stored in the session scope, so that some other data for it which is valid for the life of the session stays around). Even if it was a request scoped bean, I'd still like a way to fill out the action form before hand, because then things like Radio buttons could be preselected based on what I loaded from the database. Cheers. --- Mainguy, Mike [EMAIL PROTECTED] wrote: My angle on this is to only load the data from the database when the user is submitted a request to read data. If they are submitting an update action, I don't load the data from the database. -Original Message- From: Matt E [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 12:37 PM To: [EMAIL PROTECTED] Subject: Form Bean Help? Hello All, I'm running into a little problem, maybe someone can help me fix it. My application is driven by filling out web forms. At one point, A user can click the Save Form button, which writes the form information to a Database. When the user visits the page again, the action builds a DTO that contains all the information they had filled out and puts it in the session scope, then forwards to the JSP page that has the form on it. I had been using the value property of the struts-html tags to fill in the data, but I've noticed that when the user hits submit, if there is a validation error, they are pushed back to the page, and the data they had enetered is replaced with what was in the DTO (which is now old data). I've also run into the problem of filling in things like radio buttons, based on what was in the DTO. It seems to me that what I want to do is not pass along the DTO with the action, but fill out parts of the Form Bean before forwarding to the page that displays it, at which point I could remove the value properties of the html tags, and have everything work. My question is, how can I do this from the action? Or do I want to attack this problem in another way? Thanks! __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form Bean Help?
Matt wrote: I had been using the value property of the struts-html tags to fill in the data, but I've noticed that when the user hits submit, if there is a validation error, they are pushed back to the page, and the data they had enetered is replaced with what was in the DTO (which is now old data). Don't use the 'value' attribute, just let Struts render the HTML form elements based on what's stored in the Form bean. That will fix the redisplay on validation problem. If you need to pre-populate the form, read the DTO from the database and use BeanUtils.copyProperties(...) to copy the DTO values into the Form bean before forwarding to the view. Take a look at the struts-example webapp, it works the way you're describing. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM
Action with no associated form bean?
Hi all, I'm having some problems getting a form that has no associated form bean to display. It's basically a logout form with no fields that calls a logout action but has no form values so doesn't require a form bean - yet it seems you must have a form bean to call an action. Is this the case? Is there another solution around this or do I have to create a dummy form bean / dynaform to call the action? Thanks Oz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]