Re: Struts form bean behaviour changes after 2.5.22
can you provide example of this behaviour? regards From: Gokul Raj Sent: Saturday, November 7, 2020 5:20 AM To: Struts Users Mailing List Subject: Struts form bean behaviour changes after 2.5.22 Hello, After upgrade 2.5.22 we are facing a kind of issue, form beans remove decimal points. Does anyone face such an issue? -- Regards Gokul
Re: Struts form bean behaviour changes after 2.5.22
pon., 9 lis 2020 o 04:53 Gokul Raj napisał(a): > > I have upgraded from 2.3 to 2.5. Also, It is not occurring frequently. Did you review the migration guide? https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration#Struts2.3to2.5migration-NewLocaleawareconversionlogic This is due to fixed conversion which is now locale aware https://issues.apache.org/jira/browse/WW-4581 https://issues.apache.org/jira/browse/WW-3650 https://github.com/apache/struts/pull/138 I would assume you ou have been using some custom solution to overcome this in Strut 2.3 and now it produces problems in Struts 2.5 Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts form bean behaviour changes after 2.5.22
I have upgraded from 2.3 to 2.5. Also, It is not occurring frequently. On Sat, 7 Nov 2020 at 18:34, Lukasz Lenart wrote: > sob., 7 lis 2020 o 11:21 Gokul Raj napisał(a): > > After upgrade 2.5.22 we are facing a kind of issue, form beans remove > > decimal points. Does anyone face such an issue? > > Could you provide more details? From which version did you upgrade to > 2.5.22? > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Regards Gokul
Re: Struts form bean behaviour changes after 2.5.22
sob., 7 lis 2020 o 11:21 Gokul Raj napisał(a): > After upgrade 2.5.22 we are facing a kind of issue, form beans remove > decimal points. Does anyone face such an issue? Could you provide more details? From which version did you upgrade to 2.5.22? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts form bean behaviour changes after 2.5.22
Hello, After upgrade 2.5.22 we are facing a kind of issue, form beans remove decimal points. Does anyone face such an issue? -- Regards Gokul
RE: Struts Action Form bean population problem
Please make sure that you have getter setters in the action class. -Original Message- From: arnab.gho...@cognizant.com [mailto:arnab.gho...@cognizant.com] Sent: Thursday, August 04, 2011 2:33 AM To: user@struts.apache.org Subject: Struts Action Form bean population problem Hi Friends, I am having a strange problem. I am sending a post request to a struts action. The action class is associated with a actionform. But the problem is those values is not getting populated in the form. I have followed the correct bean spec and we are getting the values from request parameter in action form. Not sure why it is not populating the action form. Thanks, Arnab Ghosh This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Action Form bean population problem
On Thu, Aug 4, 2011 at 3:33 AM, wrote: > Not sure why it is not populating the action form. Without any further information it's impossible to help. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts Action Form bean population problem
Hi Friends, I am having a strange problem. I am sending a post request to a struts action. The action class is associated with a actionform. But the problem is those values is not getting populated in the form. I have followed the correct bean spec and we are getting the values from request parameter in action form. Not sure why it is not populating the action form. Thanks, Arnab Ghosh This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful.
Re: Change form bean properties in JSP
Am 20.05.2010 13:16, schrieb Manoj Singh: Hi, Thanks for your reply. Please let me know how to do it? Thanks, Manoj On Thu, May 20, 2010 at 4:42 PM, Robert Graf-Waczenskiwrote: Am 20.05.2010 12:50, schrieb Manoj Singh: Hi, Is it possible to change the value of form bean properties in JSP Page? If yes, then please let me know. Thanks, Manoj Yes. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Simple answer: Call the appropriate setter method of your form bean in the JSP. Less trivial options exist but depend on what you are trying to accomplish, your Struts version etc., none of which you elaborated in your original posting, hence my short reply :-) Robert - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Change form bean properties in JSP
Hi, Thanks for your reply. Please let me know how to do it? Thanks, Manoj On Thu, May 20, 2010 at 4:42 PM, Robert Graf-Waczenski wrote: > Am 20.05.2010 12:50, schrieb Manoj Singh: > > Hi, >> >> Is it possible to change the value of form bean properties in JSP Page? >> >> If yes, then please let me know. >> >> Thanks, >> Manoj >> >> >> > Yes. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: Change form bean properties in JSP
Am 20.05.2010 12:50, schrieb Manoj Singh: Hi, Is it possible to change the value of form bean properties in JSP Page? If yes, then please let me know. Thanks, Manoj Yes. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Change form bean properties in JSP
Hi, Is it possible to change the value of form bean properties in JSP Page? If yes, then please let me know. Thanks, Manoj
Re: Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5
I tried the same code with tomcat 5.5.28 server and surprisingly... it worked absolutely fine. But got no clue of what's wrong with weblogic 8.0. PS: Sandeep, Iam working with struts 1.2, please see the subject line. NanuOn Fri, 02 Apr 2010 00:14:44 +0530 wrote>in struts 2 we don't have form bean.>>If you want to access some object similar to form you need to set in action class with get and set methods and fram work will take care of other thing remove the from tag from struts config.>>Apache struts site has the wonderful startup tutorial you can go through it and start coding in 10 mins>> On 1 April 2010 17:29, Nanu Khota <nanukh...@rediffmail.com> wrote:> >>>>>-- Forwarded message -->From: "Panchal, Ashish IN GGN SISL" <ashish.panc...@siemens.com>>To: "nanukh...@rediffmail.com" <nanukh...@rediffmail.com>>Date: >Subject: Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5> Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run only. ----- SEVERE: Error creating form bean of class com.abc.struts.form.LoginForm java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457) at jsp_servlet.__login._jspService(__login.java:196) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xml http://java.sun.com/dtd/web-app_2_3.dtd">; action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 3 detail 3 0 action *.do index.jsp /WEB-INF/struts-html.tld /WEB-INF/struts-html.tld index.jsp - .. Login . struts-config.xml - http://struts.apache.org/dtds/struts-config_1_2.dtd">; attribute="loginForm" name="loginForm" path="/empLogin" scope="request" type="com.siemens.struts.action.EmpLoginAction" validate="false" /> Login.jsp - Login: Password: Login I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Nanu> Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system.>Thank You.>>>->To unsubscribe, e-mail: user-unsubscr...@struts.apache.org>For additional commands, e-mail: user-h...@struts.apache.org>>
Re: Resetting session scope form bean values
pundarik rajkhowa wrote: After I submit the form and open it again for new data entry, the form retains its old values. If I call form.reset(), it fails to clear the bean. Do I need to override the reset method and manually clear values of all bean elements? Yes--that is the purpose of the reset() method, to implement whatever non-standard functionality you need. The default doesn't do anything, so session-scoped forms will retain whatever values are already in the session. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Resetting session scope form bean values
Hi, I have a data entry form implemented as a DynaActionForm form bean in session scope. After I submit the form and open it again for new data entry, the form retains its old values. If I call form.reset(), it fails to clear the bean. Do I need to override the reset method and manually clear values of all bean elements ? Please clarify. thanks in advance, Pundarik, Struts newbie
Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5
--- Begin Message --- Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run only. - SEVERE: Error creating form bean of class com.abc.struts.form.LoginForm java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457) at jsp_servlet.__login._jspService(__login.java:196) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 3 detail 3 0 action *.do index.jsp /WEB-INF/struts-html.tld /WEB-INF/struts-html.tld index.jsp - .. Login . struts-config.xml - http://struts.apache.org/dtds/struts-config_1_2.dtd";> Login.jsp - Login: Password: Login I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Nanu Important notice: This e-mail and any attachment there to contains corporate proprietary information. If you have received it by mistake, please notify us immediately by reply e-mail and delete this e-mail and its attachments from your system. Thank You. --- End Message --- - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Error creating form bean - nullpointerexception - struts 1.2 + weblogic 8.1 + myeclipse 5.5
Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run itself. - SEVERE: Error creating form bean of class com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at jsp_servlet.__login._jspService(__login.java:196)at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app> ; <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> & nbsp; <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib></web-app> index.jsp-..<body> <html:link page="/home.do">Login</html:link> </body>. struts-config.xml-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">; <struts-config> <data-sources /> <form-beans > <form-bean name="loginForm" type="com.siemens.struts.form.LoginForm" /> </form-beans> <global-exceptions /> <global-forwards /> <action-mappings > <action attribute="loginForm" name="loginForm" path="/empLogin" scope="request" type="com.siemens.struts.action.EmpLoginAction" validate="false" /> <action forward="/Login.jsp" path="/home" /> </action-mappings> <message-resources parameter="com.siemens.struts.ApplicationResources" /></struts-config> Login.jsp- <body> <html:form action="/empLogin" method="post" focus="login"> <table border="0"> <tr> <td>Login:</td> <td><html:text property="login" /></td> </tr> <tr> <td>Password:</td> <td><html:password property="password" /></td> </tr> <tr> <td colspan="2" align="center"><html:submit>Login</html:submit></td>&nbs p; </tr> </table> </html:form> </body> I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Regards,Nanu
RE: Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5
seems like form definition isn't in struts config file or properly defined > Date: Thu, 1 Apr 2010 11:45:42 + > To: user@struts.apache.org > Subject: Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5 > From: nanukh...@rediffmail.com > > Hi All, > I am a newbee to struts and trying some hands on it. I was just trying to > develop a simple login form but getting following exception on initial run > only. > - > SEVERE: Error creating form bean of class > com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat > org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at > > org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at > org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at > org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at > org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at > jsp_servlet.__login._jspService(__login.java:196)at > weblogic.servlet.jsp.JspBase.service(JspBase.java:33) > - > I tried searching thru all forums from last 2 days but could not found any > solution to the issue. This seems to be a very common problem but I don't > know why its not going away. I am really stuck up. > Below are the listing of files required to analyize the cause of error. > web.xml PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd";> > action > org.apache.struts.action.ActionServlet > config > /WEB-INF/struts-config.xml > debug > 3 > detail & > nbsp; 3 > 0 > action*.do > > index.jsp > /WEB-INF/struts-html.tld > /WEB-INF/struts-html.tld > > index.jsp-.. page="/home.do">Login . > struts-config.xml- encoding="UTF-8"?> Foundation//DTD Struts Configuration 1.2//EN" > "http://struts.apache.org/dtds/struts-config_1_2.dtd";> > name="loginForm" type="com.siemens.struts.form.LoginForm" /> > > attribute="loginForm" name="loginForm" path="/empLogin" > scope="request" type="com.siemens.struts.action.EmpLoginAction" > validate="false" /> > >/> > Login.jsp- > > Login: > > Password: >align="center">Login&nbs > p; > I can also provide the form bean and action class if required but I believe > it won't add to solving the problem as the exception occurs when I click on > the link on index.jsp and then it tries to render the Login.jsp. > Please help. > Nanu > _ Send us your Hotmail stories and be featured in our newsletter http://clk.atdmt.com/UKM/go/195013117/direct/01/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5
Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run only. - SEVERE: Error creating form bean of class com.abc.struts.form.LoginForm java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457) at jsp_servlet.__login._jspService(__login.java:196) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xml http://java.sun.com/dtd/web-app_2_3.dtd";> action org.apache.struts.action.ActionServlet config /WEB-INF/struts-config.xml debug 3 detail 3 0 action *.do index.jsp /WEB-INF/struts-html.tld /WEB-INF/struts-html.tld index.jsp - .. Login . struts-config.xml - http://struts.apache.org/dtds/struts-config_1_2.dtd "> Login.jsp - Login: Password: Login I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Nanu
Error creating form bean - struts 1.2 + weblogic 8.1 + myeclipse 5.5
Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run only. - SEVERE: Error creating form bean of class com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at jsp_servlet.__login._jspService(__login.java:196)at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xmlhttp://java.sun.com/dtd/web-app_2_3.dtd">actionorg.apache.struts.action.ActionServletconfig/WEB-INF/struts-config.xmldebug3detail30action*.doindex.jsp/WEB-INF/struts-html.tld/WEB-INF/struts-html.tld index.jsp-..Login. struts-config.xml-http://struts.apache.org/dtds/struts-config_1_2.dtd">;
Error creating form bean struts 1.2 + weblogic 8.1 + myeclipse 5.5
Hi All, I am a newbee to struts and trying some hands on it. I was just trying to develop a simple login form but getting following exception on initial run only. - SEVERE: Error creating form bean of class com.abc.struts.form.LoginFormjava.lang.NullPointerExceptionat org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:212)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:292)at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:191)at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:477)at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)at jsp_servlet.__login._jspService(__login.java:196)at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) - I tried searching thru all forums from last 2 days but could not found any solution to the issue. This seems to be a very common problem but I don't know why its not going away. I am really stuck up. Below are the listing of files required to analyize the cause of error. web.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app> ; <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> & nbsp; <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib></web-app> index.jsp-..<body> <html:link page="/home.do">Login</html:link> </body>. struts-config.xml-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">; <struts-config> <data-sources /> <form-beans > <form-bean name="loginForm" type="com.siemens.struts.form.LoginForm" /> </form-beans> <global-exceptions /> <global-forwards /> <action-mappings > <action attribute="loginForm" name="loginForm" path="/empLogin" scope="request" type="com.siemens.struts.action.EmpLoginAction" validate="false" /> <action forward="/Login.jsp" path="/home" /> </action-mappings> <message-resources parameter="com.siemens.struts.ApplicationResources" /></struts-config> Login.jsp- <body> <html:form action="/empLogin" method="post" focus="login"> <table border="0"> <tr> <td>Login:</td> <td><html:text property="login" /></td> </tr> <tr> <td>Password:</td> <td><html:password property="password" /></td> </tr> <tr> <td colspan="2" align="center"><html:submit>Login</html:submit></td>&nbs p; </tr> </table> </html:form> </body> I can also provide the form bean and action class if required but I believe it won't add to solving the problem as the exception occurs when I click on the link on index.jsp and then it tries to render the Login.jsp. Please help. Nanu
how to generate the form-bean definition real time
In struts I have some form beans defined in struts-config.xml e.g. etc I don't really want them in struts-config because I want to a) Read the form fields from the database b) Dynamically generate the html via the JSP c) Dynamically map and save the form in my MappingDispatchAction ActionForward The only issue is in the ActionForward I have a bunch of String fieldValue = PropertyUtils.getSimpleProperty(actionForm, fieldName); and I think that getSimpleProperty depends on the bean definition in struts config and I know struts populates the form automatically for you as well but any way I can get the form bean out of the struts config file to be read from the database real time ? -- View this message in context: http://www.nabble.com/how-to-generate-the-form-bean-definition-real-time-tp20501828p20501828.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FireFox 3 and Form Bean in Session
Hi All, In my development, I put a form bean into session scope, when I access the page in Firefox 3, it is retaining the values of this form bean even if I log out and login as a different user, when I just wanted to retain the values in the same login session. This is not the case if I use IE. I am using Struts1.1 and Tomcat 4.1.30. Any help is highly appreciated. Thanks in advance. Thanks, Balwinder Kumar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action form bean values in javascript
If you're doing validation in JavaScript anyway, why wouldn't you use a JavaScript-based date validation method and avoid the heinous mixing of Java and JavaScript?! Dave --- On Thu, 7/10/08, vimala <[EMAIL PROTECTED]> wrote: > I am using struts for web application development. I have a > class > clsDateTools within which I define a function public > boolean isDate(String > dateToCheck) for validating date values. Here is my jsp > page > > <%@ page import="visg.usrBeans.clsDateTools" > %> > > > > > > <% clsDateTools datetool = new clsDateTools();%> > > function Save(){ > > > > > if(document.someActionForm.txtInspectionDate.value != > ""){ > valuefn = <% > =isDate(document.someActionForm.txtInspectionDate.value) > %>; > > if(valueFn == false){ > alert("Enter valid Complication Date in > dd/mm/"); > return false; > } > } > } > > > > > > >width="100%"> > > .. > > > >width="50%"> >class="normaltextualtheme">Inspection > Date > >width="50%"> > > > var datevalue = > "<%=request.getSession().getAttribute("txtInspectionDate")%>"; > if(datevalue=="null") { > datevalue = > "<%=datetool.stringnoDate("/")%>"; > } > if (!document.layers) { > document.write(" readonly='readonly' type=text > name=\"txtInspectionDate\" > tabindex=\"2\" > value=\""+datevalue+"\" size=10 > class=\"readonly\" >"); > document.write(" name=\"B3\" style=\"width: 20; > height: 20;background-image: > url('./images/show-calendar.gif') \" > value=\"\" > onclick='popUpCalendar(ttxtInspectionDate, > txtInspectionDate, > \"dd/mm/\");return > false;'>"); > } > > > > > > > > > > > For the code line valuefn = <% > =isDate(document.someActionForm.txtInspectionDate.value) > %>, > it shows an error message 'document is unresolved > type'. How can I pass the > action form values as parameters within javascript? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action form bean values in javascript
Hai all, I am using struts for web application development. I have a class clsDateTools within which I define a function public boolean isDate(String dateToCheck) for validating date values. Here is my jsp page <%@ page import="visg.usrBeans.clsDateTools" %> <% clsDateTools datetool = new clsDateTools();%> function Save(){ if(document.someActionForm.txtInspectionDate.value != ""){ valuefn = <% =isDate(document.someActionForm.txtInspectionDate.value) %>; if(valueFn == false){ alert("Enter valid Complication Date in dd/mm/"); return false; } } } .. Inspection Date var datevalue = "<%=request.getSession().getAttribute("txtInspectionDate")%>"; if(datevalue=="null") { datevalue = "<%=datetool.stringnoDate("/")%>"; } if (!document.layers) { document.write("<input readonly='readonly' type=text name=\"txtInspectionDate\" tabindex=\"2\" value=\""+datevalue+"\" size=10 class=\"readonly\" >"); document.write("<input type = button name=\"B3\" style=\"width: 20; height: 20;background-image: url('./images/show-calendar.gif') \" value=\"\" onclick='popUpCalendar(ttxtInspectionDate, txtInspectionDate, \"dd/mm/\");return false;'>"); } For the code line valuefn = <% =isDate(document.someActionForm.txtInspectionDate.value) %>, it shows an error message 'document is unresolved type'. How can I pass the action form values as parameters within javascript? thanks vimala -- View this message in context: http://www.nabble.com/Action-form-bean-values-in-javascript-tp18388850p18388850.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question on multipage form bean
Hi, I'm assuming that you're using Struts 1, if so ActionForms are stored in session by default [1], change scope of your action mapping to request [2] [1] http://struts.apache.org/1.3.8/userGuide/building_controller.html#action_form_classes [2] http://struts.apache.org/1.3.8/userGuide/building_controller.html#action_mapping_example Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question on multipage form bean
Hi all, I'm using a multipage form bean for a 3 page form. From what I tested, if I leave the pages (by following another link) and return later the bean is still in session scope. How can I tell struts that I've left these pages and remove the bean from session? I suppose if the user follows all the steps correctly I can do that in the final action, but what about if he clicks another link in the meantime? I'd like to invalidate the form bean in that case as well. Thanks Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: populate form bean
--- Chris Pat <[EMAIL PROTECTED]> wrote: > Can I from an Action populate a formbean, from a database, set > it in the session and forward to a jsp that is configured to use that > formbean as the encompassing formbean for the form? Sure, but you shouldn't need to set it in the session yourself; that (IIRC) is handled in the configuration file. Whether or not you should has been the subject of conversation here over the years. I'm in the "no" camp; I'd rather keep as much as possible un-tied to the S1 libraries. Just makes things easier. Other people will disagree with that. Fortunately I haven't done a new S1 app in a couple of years now, so it's okay :) > What is the syntax, where do I put the name of the formbean > in the struts form tag to match the name of the formbean > I populated from the action? I thought in S1 the form bean was named in the S1 configuration file; you shouldn't have to do anything in particular with the form tag. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
populate form bean
Hello Excuse my niavete, but I have never used a formbean for other than retrieving string data from a form. For output I have just used simple struts and jstl for output. Now I want to reverse it and would like to use more sophisticated struts tags with collections in the form bean. Simple (stupid,grin?) question. Can I from an Action populate a formbean, from a database, set it in the session and forward to a jsp that is configured to use that formbean as the encompassing formbean for the form? What is the syntax, where do I put the name of the formbean in the struts form tag to match the name of the formbean I populated from the action? Yes, I know I should try it and answer it myself, I was just hoping for a headsup and general direction. tia.
Re: Form bean
Great idea Thanks! 2008/3/6, Antonio Petrelli <[EMAIL PROTECTED]>: > > 2008/3/6, Juanjo Cuadrado <[EMAIL PROTECTED]>: > > > > > Thanks Antonio, but I need to prepopulate a ActionForm from another > Action > > and forward it to jsp... > > > > > I think that the best way to manage it is to put a simple bean (no > ActionForm) that contains the values that you want to put in request > scope, > and use EL to put them in form elements. > > For example: > > > > > Antonio >
Re: Form bean
2008/3/6, Juanjo Cuadrado <[EMAIL PROTECTED]>: > > Thanks Antonio, but I need to prepopulate a ActionForm from another Action > and forward it to jsp... I think that the best way to manage it is to put a simple bean (no ActionForm) that contains the values that you want to put in request scope, and use EL to put them in form elements. For example: Antonio
Re: Form bean
Thanks Antonio, but I need to prepopulate a ActionForm from another Action and forward it to jsp... Sorry for my English. 2008/3/6, Antonio Petrelli <[EMAIL PROTECTED]>: > > 2008/3/6, Juanjo Cuadrado <[EMAIL PROTECTED]>: > > > Hi, > > > > Where is the Form bean into the request??? What is the label?? > > > > I want to put a actionform in the request and I dont know where... > > (prepopulate???) > > > See: > http://struts.apache.org/1.x/faqs/newbie.html#prepopulate > > Antonio > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: I cannot transfer property to Form Bean
Dear Antonio, That is same in my source code..do you think that is the cause? I will check that one..And send you informations soon! God bless, Ryan Webb -- Philippines On Thu, Mar 6, 2008 at 5:03 PM, Antonio Petrelli <[EMAIL PROTECTED]> wrote: > 2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > > > > > > > > > Why two form beans with the same name? Is it a typing mistake, or an error > of your code? > > Antonio >
Re: I cannot transfer property to Form Bean
2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > Why two form beans with the same name? Is it a typing mistake, or an error of your code? Antonio
Re: I cannot transfer property to Form Bean
Yes I agree..I cannot find the problem, I think it is much better if there's 2 pairs of eyes looking. Here is the Action code. public class SortListAction extends org.apache.struts.action.Action { /* forward name="success" path="" */ private final static String SORT_LIST = "sortList"; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { SortListActionForm slaf = new SortListActionForm(); MediaDao mediaDao = new MediaDao(); ArrayList aList = mediaDao.sortMediaList(slaf.getFormatList()); request.setAttribute("medialist", aList.iterator()); return mapping.findForward(SORT_LIST); } } And here I have the ActionForm (I commented validate method since user will be selecting choices I defined): package formbeans; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; /** * * @author wst_01 */ public class SortListActionForm extends org.apache.struts.action.ActionForm{ private String formatList; public SortListActionForm() { super(); // TODO Auto-generated constructor stub } // public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // ActionErrors errors = new ActionErrors(); // if (getName() == null || getName().length() < 1) { // errors.add("name", new ActionMessage("error.name.required")); // // TODO: add 'error.name.required' key to your resources // } // return errors; // } public String getFormatList() { return formatList; } public void setFormatList(String formatList) { this.formatList = formatList; } } And lastly, I have here the Struts-config.xml I attached files you requested, I think it's much better to see them in color..=) I also attached files related to databases..(just incase you might need them). God bless, Ryan Webb -- Philippines On Thu, Mar 6, 2008 at 4:42 PM, Antonio Petrelli <[EMAIL PROTECTED]> wrote: > 2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > > > Yes I did select an element I choose DVD+R then when I click sort now > > button > > the WebPage exploded > > containing Tomcat Error Message. (null pointer exception). > > > > Mmmm this is strange. Can I see your Action, ActionForm and > struts-config.xml (related to this action) code? > > Antonio > http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd";> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I cannot transfer property to Form Bean
2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > Yes I did select an element I choose DVD+R then when I click sort now > button > the WebPage exploded > containing Tomcat Error Message. (null pointer exception). Mmmm this is strange. Can I see your Action, ActionForm and struts-config.xml (related to this action) code? Antonio
Re: I cannot transfer property to Form Bean
Dear Antonio, Yes I did select an element I choose DVD+R then when I click sort now button the WebPage exploded containing Tomcat Error Message. (null pointer exception). By the way, thank you very much for reading my email and for the reply..=) God bless, Ryan Webb --Philippines On Thu, Mar 6, 2008 at 4:35 PM, Antonio Petrelli <[EMAIL PROTECTED]> wrote: > 2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > > > > > > > > > > > > > > > > > when I am debugging, I found out that formatList property > > fromSortListFormBean.java is always equal to null. > > > > I am doing something wrong? > > Do you select an element before submitting the form? > > Antonio > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: I cannot transfer property to Form Bean
2008/3/6, ryan webb <[EMAIL PROTECTED]>: > > > > > > > > > when I am debugging, I found out that formatList property > fromSortListFormBean.java is always equal to null. > > I am doing something wrong? Do you select an element before submitting the form? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form bean
2008/3/6, Juanjo Cuadrado <[EMAIL PROTECTED]>: > Hi, > > Where is the Form bean into the request??? What is the label?? > > I want to put a actionform in the request and I dont know where... > (prepopulate???) See: http://struts.apache.org/1.x/faqs/newbie.html#prepopulate Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I cannot transfer property to Form Bean
Dear fellow Struts users, I am new in using Struts and I request your help. Situation: I am using Netbeans 6.0; Struts 1.2.9; Tomcat 6.0.14 I created an in my jsp page, what is it does is for sorting purposes. here's the snippet: And for my SortListFormBean.java I have a property private String formatList with Getter and Setter Problem: when I am debugging, I found out that formatList property fromSortListFormBean.java is always equal to null. I am doing something wrong? Godbless, Ryan Webb --Philippines
Form bean
Hi, Where is the Form bean into the request??? What is the label?? I want to put a actionform in the request and I dont know where... (prepopulate???) Thanks.
Re: form bean directly into session
However, how do I refer to my placed formBean from a struts tag? One way to do it would be: now "foo" is a variable within your JSP page with the value "fname" from your form. How does it know the difference from my formBean and the default formBean created from ApplicationResources? FormBeans are created on demand according to the mapping of the requested resource. This means that if the request mapping was "myPath.do" with scope="request", then a new Form will be instantiated, otherwise the form will be looked in the HttpSession object. If none is there, a new one will be instantiated and placed there as an attribute. I guess I never heard of "applicationResources" creating forms (such file typically contains resource bundles) Can I refer to it as: This should be valid code, however keep in mind that this is only because the "myFormBeanName" bean (Form) is in scope (session). If it wouldn't, this would have thrown an NPE. I believe the correct expression should be: From the documentation (http://struts.apache.org/1.x/struts-taglib/tagreference.html#text): "The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized." The default value of the tag is to load the current value of the "fname" from the Form object mapped to the surrounding . Using it this way (as you wrote will always force to use the Form object in session. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean directly into session
Hi Alberto Thank you. However, how do I refer to my placed formBean from a struts tag? How does it know the difference from my formBean and the default formBean created from ApplicationResources? Can I refer to it as: "Alberto A. Flores" <[EMAIL PROTECTED]> wrote: > I have a form with many, many fields on it. I would like to process some of > them in my Action but get all them into the session object so my forwarded > jsp can use them as the values. So may I ask: > 1. How can I put the entire form bean from an action into the session scope > without extracting each name/value pair and individually putting that in the > session? Set scope="session" in struts-config mapping. > 2. From the forwarded jsp, how do I access the placed form bean and use the > getters for the value of input fields? Thank you. use struts tags, where the bean name is the name of the form as defined in struts-config. Alternatively, you could use JSTL to access these forms (beans) as well. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form bean directly into session
I have a form with many, many fields on it. I would like to process some of them in my Action but get all them into the session object so my forwarded jsp can use them as the values. So may I ask: 1. How can I put the entire form bean from an action into the session scope without extracting each name/value pair and individually putting that in the session? Set scope="session" in struts-config mapping. 2. From the forwarded jsp, how do I access the placed form bean and use the getters for the value of input fields? Thank you. use struts tags, where the bean name is the name of the form as defined in struts-config. Alternatively, you could use JSTL to access these forms (beans) as well. -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form bean directly into session
Hello I have a form with many, many fields on it. I would like to process some of them in my Action but get all them into the session object so my forwarded jsp can use them as the values. So may I ask: 1. How can I put the entire form bean from an action into the session scope without extracting each name/value pair and individually putting that in the session? 2. From the forwarded jsp, how do I access the placed form bean and use the getters for the value of input fields? Thank you.
Re: Struts input sends < > encoded as < and > to form bean. Help!
2007/12/6, zargarf <[EMAIL PROTECTED]>: > > I was wondering, if there's anyway to automatically convert these back to > the original < > characters before they are set to the form attributes. Probably you are interested in Commons Lang StringEscapeUtils.unescapeXml: http://commons.apache.org/lang/api-release/org/apache/commons/lang/StringEscapeUtils.html#unescapeXml(java.lang.String) Antonio
Struts input sends < > encoded as < and > to form bean. Help!
Hi Got a problem. We're using the struts portlet framework for websphere portal and are encountering an issue whereby if a user inputs the following characters, < > or £, then the form bean receives the values as < > etc. As this problem has only been noticed a year down the line, the information is getting stored in the database (via Hibernate) as <, > etc. I was wondering, if there's anyway to automatically convert these back to the original < > characters before they are set to the form attributes. Cheers Faisal Zargar -- View this message in context: http://www.nabble.com/Struts-input-sends-%3C-%3E-encoded-as--lt--and--gt--to-form-bean.-Help%21-tf4955929.html#a14191931 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem deploying my application with weblogic after adding a new form bean
Hi all, Am having problem deploying my application with weblogic after adding a new form bean and its configuration () in the struts-config.xml the funny thing is with the configuration intact and the formbean java class deleted, the deployment goes through successfully. what could be the potential problem???... following is the error log help will be very much appreciated thanks for reading my guess the problem should lies with these statements(extracted from the codes i paste below): "[ActionServlet] ERROR: Parsing error processing resource path java.lang.reflect.InvocationTargetException at org.apache.commons.digester.Digester.createSAXException(Ljava/lang/String;Ljava/lang/Exception;)" [CODE] [Digester] ERROR: Begin event threw exception java.lang.reflect.InvocationTargetException at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source) at jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source) at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Sour ce) at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Unknown Source) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V(P ropertyUtils.java:1650) at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V(P ropertyUtils.java:1545) at org.apache.commons.beanutils.PropertyUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V(Propert yUtils.java:1574) at org.apache.commons.beanutils.BeanUtils.setProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V(BeanUtils.j ava:919) at org.apache.commons.beanutils.BeanUtils.populate(Ljava/lang/Object;Ljava/util/Map;)V(BeanUtils.java:726) at org.apache.commons.digester.SetPropertiesRule.begin(Lorg/xml/sax/Attributes;)V(SetPropertiesRule.java:259) at org.apache.commons.digester.Rule.begin(Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Attributes;)V(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/At tributes;)V(Digester.java:1273) at weblogic.apache.xerces.parsers.AbstractSAXParser.startElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apache/xerces /xni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;)V(AbstractSAXParser.java:459) at weblogic.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apach e/xerces/xni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;)V(AbstractXMLDocumentParser.java:221) at weblogic.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apache/xerce s/xni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;)V(XMLSchemaValidator.java:618) at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apache/xe rces/xni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;Z)V(XMLNamespaceBinder.java:874) at weblogic.apache.xerces.impl.XMLNamespaceBinder.emptyElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apache/xerces/x ni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;)V(XMLNamespaceBinder.java:591) at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Lweblogic/apache/xerces/xni/QName;Lweblogic/apache/xerces/ xni/XMLAttributes;Lweblogic/apache/xerces/xni/Augmentations;)V(XMLDTDValidator.java:748) at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement()Z(XMLDocumentFragmentScannerImpl.java:747) at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z(XMLDocumentFragmentSc annerImpl.java:1477) at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z(XMLDocumentFragmentScannerImpl.java:329) at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Z)Z(DTDConfiguration.java:525) at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Lweblogic/apache/xerces/xni/parser/XMLInputSource;)V(DTDConfigura tion.java:581) at weblogic.apache.xerces.parsers.XMLParser.parse(Lweblogic/apache/xerces/xni/parser/XMLInputSource;)V(XMLParser.java:152) at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(Lorg/xml/sax/InputSource;)V(AbstractSAXParser.java:1175) at weblogic.xml.jaxp.WebLogicXMLReader.parse(Lorg/xml/sax/InputSource;)V(WebLogicXMLReader.java:135) at weblogic.xml.jaxp.RegistryXMLReader.parse(Lorg/xml/sax/InputSource;)V(RegistryXMLReader.java:152)
how to get a dynamic form bean object if it's not linked to the action
Hi, I've got the survey-like application. Survey is divided into several pages and each of those is represented by a dynamic action form. All forms are stored in the session. Once survey is completed it's stored in the database and anyone can go back at any time, retrieve his/her results, change them and re-submit. My problem is in pre-loading forms with database data. The most convenient way is to pre-load all forms with data once and then redirect control to the "normal" survey flow. The problem is though that I can't find a way to create a dynamic action form which is not linked to the current action. Let's say action "LoadSurvey" has to create/get action form beans (which are defined in Struts configuration of course) "DForm1", "DForm2", etc. Is there a way to do it? Cheers, Leo You will note this email address may have changed. Please update your records accordingly. * This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, any use, disclosure or copying of this message is unauthorised. If you have received this message in error, please reply using the sender's email address. This footnote confirms that this email message has been scanned for computer viruses. Ansvar Insurance Limited does not accept liability for any loss or damage, whether caused by our own negligence or not, that results from a computer virus or defect in the transmission of this email or any attached file. Ansvar Insurance Limited - Australia (A.B.N. 21 007 216 506) Email : [EMAIL PROTECTED] Ansvar Insurance Limited - New Zealand Email : [EMAIL PROTECTED] *
form bean>form-property>type please help
Can we set a type of a form-property as array of Objects? Example: OR set them as ArrayList(Collection) Like: Another question: If both are possible then which one is better for which context Ehteshamul Haque - Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
Re: Struts 2.0 form bean
Before anything try model driven interface if you are not doing any portlet developments. Thanks, --- [EMAIL PROTECTED] wrote: > Hi All, > > As there is no concept of Action form beans in > struts 2.0 we have to define > the field attributes in the Action class. > > I am using the same action class for two form > submission, is there any way > of configuring form beans to this actions. > > For example if my first form has fields name, > address, sex and second > form has company, salary. > I am using the same action class for the above form > submission i.e. > processPersonalDetails() and > processEmplymentDetails() > is there any way of defining this fields attribute > in two separate bean > classes and configure with the appropriate action.? > > Thanks, > Manoj. > > > This e-mail is intended to be confidential to the > recipient. If you receive a copy in error, please > inform the sender and then delete this message. > Virgin Money do not accept responsibility for > changes made to any e-mail after sending. Virgin > Money have swept, and believe this e-mail to be free > of viruses and profanity but make no guarantees to > this effect. > > Virgin Money Personal Financial Service Ltd is > authorised and regulated by the Financial Services > Authority. Registered in England no. 3072766. > Entered on the Financial Services Authority's > Register http://www.fsa.gov.uk/register/. Register > Number 179271. The Virgin Deposit Account is a > personal bank account with The Royal Bank of > Scotland. > > Virgin Money Unit Trust Managers Ltd is authorised > and regulated by the Financial Services Authority. > Registered in England no. 3000482. Entered on the > Financial Services Authority's Register. Register > Number 171748. > > Virgin Money Ltd. Registered in England no. 4232392. > Introducer appointed representative only of Virgin > Money Personal Financial Service Ltd. > > Virgin Money Management Services Ltd. Registered in > England no.3072772. > > Virgin Money Group Ltd. Registered in England > no.3087587. > > All the above companies have their Registered office > at Discovery House, Whiting Road, Norwich NR4 6EJ. > > All products are open only to residents of the > United Kingdom. > > This message has been checked for viruses and spam > by the Virgin Money email scanning system powered by > Messagelabs. > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Get the Yahoo! toolbar and be alerted to new email wherever you're surfing. http://new.toolbar.yahoo.com/toolbar/features/mail/index.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0 form bean
Thanks David it worked... Dave Newton <[EMAIL PROTECTED] o.com> To Struts Users Mailing List 29/06/2007 14:51 cc Please respond to Subject "Struts Users Re: Struts 2.0 form bean Mailing List" <[EMAIL PROTECTED] he.org> --- [EMAIL PROTECTED] wrote: > In the action class i defined a attribute called > > public PersonalDetailForm getForm() { > return form; > } > > public void setForm(PersonalDetailForm form) { > this.form = form; > } > > PersonalDetailForm form; > > > and the jsp looks like > name="form"> > > > > How would S2 know what "name" belonged to if you didn't say "form.name" ? Personally I think you're going about the problem the wrong way; I'd think less in terms of S1. d. Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs. This e-mail is intended to be confidential to the recipient. If you receive a copy in error, please inform the sender and then delete this message. Virgin Money do not accept responsibility for changes made to any e-mail after sending. Virgin Money have swept, and believe this e-mail to be free of viruses and profanity but make no guarantees to this effect. Virgin Money Personal Financial Service Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3072766. Entered on the Financial Services Authority's Register http://www.fsa.gov.uk/register/. Register Number 179271. The Virgin Deposit Account is a personal bank account with The Royal Bank of Scotland. Virgin Money Unit Trust Managers Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3000482. Entered on the Financial Services Authority's Register. Register Number 171748. Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed representative only of Virgin Money Personal Financial Service Ltd. Virgin Money Management Services Ltd. Registered in England no.3072772. Virgin Money Group Ltd. Registered in England no.3087587. All the above companies have their Registered office at Discovery House, Whiting Road, Norwich NR4 6EJ. All products are open only to residents of the United Kingdom. This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0 form bean
--- [EMAIL PROTECTED] wrote: > In the action class i defined a attribute called > > public PersonalDetailForm getForm() { > return form; > } > > public void setForm(PersonalDetailForm form) { > this.form = form; > } > > PersonalDetailForm form; > > > and the jsp looks like > name="form"> > > > > How would S2 know what "name" belonged to if you didn't say "form.name" ? Personally I think you're going about the problem the wrong way; I'd think less in terms of S1. d. Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games. http://sims.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0 form bean
Hi Dave, Thanks for your reply. I tried defining a java bean as below public class PersonalDetailForm implements Serializable { String name; String dob; String city; public PersonalDetailForm() {} // also defined all the getter setter methods } In the action class i defined a attribute called public PersonalDetailForm getForm() { return form; } public void setForm(PersonalDetailForm form) { this.form = form; } PersonalDetailForm form; and the jsp looks like in the action class when i do a form.getCity() it throws a NUllPointerException i think the form is not initialised on the form submission... unlike struts 1.x we cannot confire the bean class in the struts-config.xml Can you please help? Manoj. Dave Newton <[EMAIL PROTECTED] o.com> To Struts Users Mailing List 29/06/2007 13:53 cc Please respond to Subject "Struts Users Re: Struts 2.0 form bean Mailing List" <[EMAIL PROTECTED] he.org> --- [EMAIL PROTECTED] wrote: > is there any way of defining this fields attribute > in two separate bean classes and configure with the > appropriate action? Use regular JavaBeans and use the appropriate bean in the JSP form and configure validation for each bean/method combination. That's a really, really long signature. This e-mail is intended to be confidential to the recipient. If you receive a copy in error, please inform the sender and then delete this message. Virgin Money do not accept responsibility for changes made to any e-mail after sending. Virgin Money have swept, and believe this e-mail to be free of viruses and profanity but make no guarantees to this effect. Virgin Money Personal Financial Service Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3072766. Entered on the Financial Services Authority's Register http://www.fsa.gov.uk/register/. Register Number 179271. The Virgin Deposit Account is a personal bank account with The Royal Bank of Scotland. Virgin Money Unit Trust Managers Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3000482. Entered on the Financial Services Authority's Register. Register Number 171748. Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed representative only of Virgin Money Personal Financial Service Ltd. Virgin Money Management Services Ltd. Registered in England no.3072772. Virgin Money Group Ltd. Registered in England no.3087587. All the above companies have their Registered office at Discovery House, Whiting Road, Norwich NR4 6EJ. All products are open only to residents of the United Kingdom. This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.0 form bean
--- [EMAIL PROTECTED] wrote: > is there any way of defining this fields attribute > in two separate bean classes and configure with the > appropriate action? Use regular JavaBeans and use the appropriate bean in the JSP form and configure validation for each bean/method combination. That's a really, really long signature. > This e-mail is intended to be confidential to the > recipient. If you receive a copy in error, please > inform the sender and then delete this message. > Virgin Money do not accept responsibility for > changes made to any e-mail after sending. Virgin > Money have swept, and believe this e-mail to be free > of viruses and profanity but make no guarantees to > this effect. > > Virgin Money Personal Financial Service Ltd is > authorised and regulated by the Financial Services > Authority. Registered in England no. 3072766. > Entered on the Financial Services Authority's > Register http://www.fsa.gov.uk/register/. Register > Number 179271. The Virgin Deposit Account is a > personal bank account with The Royal Bank of > Scotland. > > Virgin Money Unit Trust Managers Ltd is authorised > and regulated by the Financial Services Authority. > Registered in England no. 3000482. Entered on the > Financial Services Authority's Register. Register > Number 171748. > > Virgin Money Ltd. Registered in England no. 4232392. > Introducer appointed representative only of Virgin > Money Personal Financial Service Ltd. > > Virgin Money Management Services Ltd. Registered in > England no.3072772. > > Virgin Money Group Ltd. Registered in England > no.3087587. > > All the above companies have their Registered office > at Discovery House, Whiting Road, Norwich NR4 6EJ. > > All products are open only to residents of the > United Kingdom. > > This message has been checked for viruses and spam > by the Virgin Money email scanning system powered by > Messagelabs. d. Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 2.0 form bean
Hi All, As there is no concept of Action form beans in struts 2.0 we have to define the field attributes in the Action class. I am using the same action class for two form submission, is there any way of configuring form beans to this actions. For example if my first form has fields name, address, sex and second form has company, salary. I am using the same action class for the above form submission i.e. processPersonalDetails() and processEmplymentDetails() is there any way of defining this fields attribute in two separate bean classes and configure with the appropriate action.? Thanks, Manoj. This e-mail is intended to be confidential to the recipient. If you receive a copy in error, please inform the sender and then delete this message. Virgin Money do not accept responsibility for changes made to any e-mail after sending. Virgin Money have swept, and believe this e-mail to be free of viruses and profanity but make no guarantees to this effect. Virgin Money Personal Financial Service Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3072766. Entered on the Financial Services Authority's Register http://www.fsa.gov.uk/register/. Register Number 179271. The Virgin Deposit Account is a personal bank account with The Royal Bank of Scotland. Virgin Money Unit Trust Managers Ltd is authorised and regulated by the Financial Services Authority. Registered in England no. 3000482. Entered on the Financial Services Authority's Register. Register Number 171748. Virgin Money Ltd. Registered in England no. 4232392. Introducer appointed representative only of Virgin Money Personal Financial Service Ltd. Virgin Money Management Services Ltd. Registered in England no.3072772. Virgin Money Group Ltd. Registered in England no.3087587. All the above companies have their Registered office at Discovery House, Whiting Road, Norwich NR4 6EJ. All products are open only to residents of the United Kingdom. This message has been checked for viruses and spam by the Virgin Money email scanning system powered by Messagelabs. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do i populate the form bean with a list of variable number of enteries.?
hi, I wanted to know if there is any way to populate a form bean with a list which is variable in number. For example : If i need to read the names of all the students in class. On page 1 i read the number of students (= n) and on the next page based on this number i display "n" number of test boxes to enter the names of the students. My real question is how do i get the form bean to populate all these variable number of entries into a list. please let me know if i am not being clear. Regards , Chaitanya Deshpande
RE: initialize java form bean
Ok. Thanks. Will try it out tonight. -Original Message- From: Harring Figueiredo [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 14, 2007 4:26 PM To: Struts Users Mailing List Subject: Re: initialize java form bean Try Value you want Make sure your action has the method that match accessors for the attribute. In the case above, you need public String setNameOfAttribute(String va){ } Hope this helps. Harring On 3/14/07, Lim Hock-Chai <[EMAIL PROTECTED]> wrote: > > is there a way to set a property of a java form bean from > struts-config.xml? > > I try to use set-property and it is not working. > -- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] Telephone: 941-256-0600 "We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initialize java form bean
--- Lim Hock-Chai <[EMAIL PROTECTED]> wrote: > is there a way to set a property of a java form bean > from struts-config.xml? > > I try to use set-property and it is not working. Which version of Struts (I'm assuming Struts 1, but which version?) What did you try already? d. The fish are biting. Get more visitors on your site using Yahoo! Search Marketing. http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initialize java form bean
Try Value you want Make sure your action has the method that match accessors for the attribute. In the case above, you need public String setNameOfAttribute(String va){ } Hope this helps. Harring On 3/14/07, Lim Hock-Chai <[EMAIL PROTECTED]> wrote: is there a way to set a property of a java form bean from struts-config.xml? I try to use set-property and it is not working. -- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] Telephone: 941-256-0600 "We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided."
initialize java form bean
is there a way to set a property of a java form bean from struts-config.xml? I try to use set-property and it is not working.
Accessing form bean properties from within JavaScript
I like to do the following: When a selection in a select box changes, display a value from a mapped property in a textarea field. To do this I need to get the currently selected value of the ComboBox by calling some javascript function in the onchange event of SELECT. This is my JSP code: onchange="displayReportDescription()"> name="reportDescriptions" value="value.report_ID" label="value.report_Name"/> disabled="false"/> The javascript function displayReportDescription() returns the currently selected value of the ComboBox (Select list) In the form bean I have a Hashtable as follows: private Hashtable availableReports; public synchronized Hashtable getAvailableReports() { return availableReports; } public synchronized void setAvailableReports( Hashtable availableReports) { this.availableReports = availableReports; } public ReportDescription getValue(String key) { return availableReports.get(key); } With these getters I should be able to do the following in my JSP to retrieve a specific value from my Hashtable: where name is the VALUE of the currently selected Item of the Select box. So inside my javascript function I should do something like: function displayReportDescription() { var ComboBox=document.forms[0].elements["reportKind"]; var selected = ComboBox.selectedIndex; var selectedValue = ComboBox.options[selected].value; document.forms[0].elements["reportDescription"].value = THE VALUE FROM MY HASHTABLE IN MY FORMBEAN!! } The question is how can I call the getAvailableReports().getValue(selectedValue) of my form bean from inside the above JavaScript Any help would be greatly appreciated. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts 1.2.9 multiple session scoped action form bean usage by single jsp
Struts 1.2.9 I have 2 session scoped form beans which share a getter method. I would like to re-use a particular jsp in this case as well. However, what I'm finding is that the first session scoped form encountered will be the one the jsp gets its values from. This may well not be the form used by the action. Thus, resulting in incorrect values. I have a solution to the problem. Basically, copy the jsp which I'm attempting to re-use and identify the form bean by name using dot notation with the field, but this seems a like it adds unnecessary maintenance (have to maintain 2 copies of essentially the same jsp). Is there a simple solution which I may be missing at the moment? Thanks, Derrick
Re: Is it possible to paramterize calls to form bean getters?
OK thanks. This was my original approach, except now I am having trouble with the bean:write + formatKey approach - please see my other post entitled "formatting money values with bean:write". So summarise: It seems that whenever the formatKey specification results in a lookup of a format String that does not match the client-side the formatting fails with the stack trace below. eg: The default format String is "#,##0.00". The client side locale is Portugal (currency format = "#.#00,00") There is no specific property bundle for Portugal - so the default format String should be used. However the formatting fails with the stack trace below. I have looked at WriteTag.java (Struts 1.1) and to be honest I cannot see how it can work. A format String is always found because the PropetyMessageResources class first tries to find a locale specific resource, then returns the default locale resource (which is always present). However, and this is the nub of the question I believe, because a formatString has been found, WriteTag.java then calls "( ( DecimalFormat ) format ).applyLocalizedPattern( formatString );". My understanding is hat the param passed to "applyLocalizedPattern()" must match the required pattern for the locale that the DecimalFormat instance was constructed with? If my assumption is correct then the default format string will very often be wrong, and cause the exception. Basically, AFAICS the applyLocalizedPattern(formatString) will always be called because the resource lookup always succeeds if the resource is present at all (i.e. not specifically for the client-side locale). The applyLocalizedPattern(formatString) will then fail if the pattern does not match that required by the locale. Or am I missing something? Surely I must be :-) Any help totally appreciated Thanks in advance - Adam Stack Trace: javax.servlet.jsp.JspException: Wrong format string: '#,##0.00' at org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:376) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:292) at org.apache.jsp.pages.pec.Pec_jsp._jspx_meth_bean_write_26(Pec_jsp.java:6518) at org.apache.jsp.pages.pec.Pec_jsp._jspService(Pec_jsp.java:3746) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at com.expensys.expensyswt.struts.filters.TimeoutFilter.doFilter(TimeoutFilter.java:184) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at com.expensys.expensyswt.struts.filters.AvailabilityFilter.doFilter(AvailabilityFilter.java:130) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
Re: Extend form-bean in struts-config
[EMAIL PROTECTED] wrote: Hi In my struts config, I have a few forms, with type DynaValidatorForm. The problem is, I have a few forms who share a few fields. Is there a way to declare a superform and let the other extend that form, so that I don't have to declare the common fields for every form? Yes, using the 'extends' attribute. Something like: ... ... Note, this is a relatively recent feature in Struts 1, so you may need to upgrade to take advantage of it (I believe it was introduced in the 1.3 series). L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is it possible to paramterize calls to form bean getters?
Adam Lipscombe wrote: Folks I need to internationalize an app - returning Locale specific formats for currency and date. One way to do that is to add getLocalised() and setLocalised() to the formbeans for each affected property. These methods will then apply whatever formatting is needed. Ugh, you'd have to have a seperate getter/setter pair for every locale you wanted to support, and how would you know which one to call in the JSP? But, for the tag to work this involves having an extra getter/setter for each property that needs localisation. Is there anyway round this? Is there an accepted solution? Your getters/setters shouldn't need to know about the locale, they just make the data available. Formatting for locale should happen in the view. Format strings go in your per-locale resource bundle, and are referenced with the formatKey attribute of the bean:write tag [1]. There are other ways to do the same thing (including using the JSTL 'fmt' tags/functions instead of bean:write), but the objective is the same: make formatting data part of your localization resources. L. [1] http://struts.apache.org/1.x/struts-taglib/tlddoc/bean/write.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Extend form-bean in struts-config
Hi In my struts config, I have a few forms, with type DynaValidatorForm. The problem is, I have a few forms who share a few fields. Is there a way to declare a superform and let the other extend that form, so that I don't have to declare the common fields for every form? Tia Bjorn De Bakker This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Is it possible to paramterize calls to form bean getters?
Folks I need to internationalize an app - returning Locale specific formats for currency and date. One way to do that is to add getLocalised() and setLocalised() to the formbeans for each affected property. These methods will then apply whatever formatting is needed. But, for the tag to work this involves having an extra getter/setter for each property that needs localisation. Is there anyway round this? Is there an accepted solution? TIA - Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S1] Select multiple matching values from form bean
Grant Harding wrote: Hi, I'm trying to create an 'edit form' page. In this, I'm trying to populate a multiple select field with a bean in the request scope and match the selected values from the form. I'm not sure how to get this to work. After looking in the taglib source, it looks like I have to specify another collection with the properties I want to match. Is there any way to do this just by using the array of ints kept in the form? This is my select tag: affiliates is taken from the form and is of type int[] with one value: 1 affils is an ArrayList in the request scope and contains Affiliate beans, with a getId and getTitle method. Is there someway to set selected="selected" on each of the items in affils where the value of getId() is found in the affiliates array? That should happen automatically. What type does Affiliate.getId() return? Are you selections saved correctly into the affiliates property of your form bean when you submit the form? L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S1] Select multiple matching values from form bean
Hi, I'm trying to create an 'edit form' page. In this, I'm trying to populate a multiple select field with a bean in the request scope and match the selected values from the form. I'm not sure how to get this to work. After looking in the taglib source, it looks like I have to specify another collection with the properties I want to match. Is there any way to do this just by using the array of ints kept in the form? This is my select tag: affiliates is taken from the form and is of type int[] with one value: 1 affils is an ArrayList in the request scope and contains Affiliate beans, with a getId and getTitle method. Is there someway to set selected="selected" on each of the items in affils where the value of getId() is found in the affiliates array? Thanks, Grant Harding
RE: Form Bean not able to read form rendered from xml/xsl
Hi Rajeev, People here have mostly been away from their desks for the last few days, so you might see some more replies soon. My first impression is that you're mixing up what XSLT does and what Struts does. XSLT does a transformation from an XML document to some other form: in this case, it appears that you're creating HTML. XSLT does nothing that would have anything to do with whether or not Struts can handle your form bean correctly. So the first thing I'd look at is what the result of the XSLT transformation is. If you're getting the results you expect there, which would be something like your second example, then you need to look at why Struts isn't able to handle the setter/getter properly (my first guess would be that you have a problem with your cases, but you'd have to check that). If you're not getting the results you expect from your XSLT, then there's a problem with the XSLT. If it's an XSLT problem, you'd have more luck asking the XSLT list at [EMAIL PROTECTED] Good luck! Chris Loschen -Original Message- From: Rajeev Kumar Pandey [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 26, 2006 4:38 AM To: user@struts.apache.org Subject: RE: Form Bean not able to read form rendered from xml/xsl Hi All, Resending my query since I did not receive any replies to the same. Kindly help. Regards, Rajeev From: Rajeev Kumar Pandey Sent: Friday, December 22, 2006 8:00 PM To: 'user@struts.apache.org' Subject: Form Bean not able to read form rendered from xml/xsl Hi All, I am new to this mailing list, so might not be able to pose my question appropriately. Kindly bear with me. I am facing an issue with use of form beans in my project to read html forms rendered through xml/xsl. When I use UserId hidden the formbean is not able to pick the value from the form. But in the other part of the code where I use the getter and setter method is called for the above parameter. Is there an equivalent for xsl:element so that my action class can read UserId from the formbean? Thanks and Regards Rajeev Kumar Pandey CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form Bean not able to read form rendered from xml/xsl
Hi All, Resending my query since I did not receive any replies to the same. Kindly help. Regards, Rajeev From: Rajeev Kumar Pandey Sent: Friday, December 22, 2006 8:00 PM To: 'user@struts.apache.org' Subject: Form Bean not able to read form rendered from xml/xsl Hi All, I am new to this mailing list, so might not be able to pose my question appropriately. Kindly bear with me. I am facing an issue with use of form beans in my project to read html forms rendered through xml/xsl. When I use UserId hidden the formbean is not able to pick the value from the form. But in the other part of the code where I use the getter and setter method is called for the above parameter. Is there an equivalent for xsl:element so that my action class can read UserId from the formbean? Thanks and Regards Rajeev Kumar Pandey CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Form Bean not able to read form rendered from xml/xsl
Hi All, I am new to this mailing list, so might not be able to pose my question appropriately. Kindly bear with me. I am facing an issue with use of form beans in my project to read html forms rendered through xml/xsl. When I use UserId hidden the formbean is not able to pick the value from the form. But in the other part of the code where I use the getter and setter method is called for the above parameter. Is there an equivalent for xsl:element so that my action class can read UserId from the formbean? Thanks and Regards Rajeev Kumar Pandey CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: Validating a form bean
Do you have accessors and mutators for your attributes? Those private variables can't be accessed by Struts without them. (*Chris*) On 02 Nov 2006 11:50:14 +0100, Jorge Martín Cuervo < [EMAIL PROTECTED]> wrote: El jue, 02 de 11 de 2006 a las 11:45, chamal desilva escribió: in the method validate in CustomerForm class you must call the validate method of AccountClass. > Hi, > > I have a form bean as this one > > public class CustomerForm extends ActionForm > { > private AccountForm accForm = null; > // other attributes and methods > > } > > > My JSP looks like this. It has a form which contains > details of CustomerForm as well as AccountForm inside > CustomerForm. > > >Customer Name >Customer Age > >account num >account numproperty="accForm.balance"> > > > But when I submit the page only the contents of > CustomerForm is validated. AccountForm's validate > method does not get called. > > Best Regards, > Chamal. > > > > > Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates > (http://voice.yahoo.com) > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- ;-) Jorge Martin Cuervo Analista Programador Outsourcing Emarketplace deFacto Powered by Standards email <[EMAIL PROTECTED]> voz +34 985 129 820 voz +34 660 026 384
Re: Validating a form bean
El jue, 02 de 11 de 2006 a las 11:45, chamal desilva escribió: in the method validate in CustomerForm class you must call the validate method of AccountClass. > Hi, > > I have a form bean as this one > > public class CustomerForm extends ActionForm > { > private AccountForm accForm = null; > // other attributes and methods > > } > > > My JSP looks like this. It has a form which contains > details of CustomerForm as well as AccountForm inside > CustomerForm. > > >Customer Name >Customer Age > >account num >account numproperty="accForm.balance"> > > > But when I submit the page only the contents of > CustomerForm is validated. AccountForm's validate > method does not get called. > > Best Regards, > Chamal. > > > > > Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates > (http://voice.yahoo.com) > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- ;-) Jorge Martin Cuervo Analista Programador Outsourcing Emarketplace deFacto Powered by Standards email <[EMAIL PROTECTED]> voz +34 985 129 820 voz +34 660 026 384
Validating a form bean
Hi, I have a form bean as this one public class CustomerForm extends ActionForm { private AccountForm accForm = null; // other attributes and methods } My JSP looks like this. It has a form which contains details of CustomerForm as well as AccountForm inside CustomerForm. Customer Name Customer Age account num account num But when I submit the page only the contents of CustomerForm is validated. AccountForm's validate method does not get called. Best Regards, Chamal. Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates (http://voice.yahoo.com) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retain Form Bean
Puneet Lakhina wrote: On 10/28/06, Laurie Harper <[EMAIL PROTECTED]> wrote: Puneet Lakhina wrote: > hi, > I have the following scenario. I have a form that takes certain input. This > in effect goes through certain validations. Now what I want to do is in > case > of validation errors a seprarte page is displayed that lists all the > errors, > and asks the user to continue submitting the data ignoring the errors, > or to > go back to the form and change the data. > My question is how do i submit the data from my error page (which is a > different page), in case the user chooses to continue to submit ignoring > the > errors. > > So the flow is like this > > form submit-> if errors - >error page - >if continue ->submit data and > store > in Database. > > This continue functionality is what im unable to achieve because I dont > know > how to resubmit the same form values from the error page. > > Any clues?? I can think of at least two ways to do this: 1) use session scope for your form bean; wheter the user decides to return and re-edit his data, or submit it, the data is still in the session-scoped form Thats what I did. Is that a good thing to do?? Yes, provided you are OK with putting data into the session. Some people prefer to avoid that at all costs :-) 2) if you want to avoid using the session, you could serialize the submitted data as hidden fields in the error page; then the user submits that page, their inputs will be re-submitted from the hidden fields, and thus available to the next action Thought of this..but wouldnt that make code maintanence a problem. I mean i add a field to the old form..n il have to add it here..n so on... what do you think?? Well, if I was going to take that approach, I'd probably look for a way to automate it so I didn't have to maintain the mapping by hand. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retain Form Bean
On 10/28/06, Laurie Harper <[EMAIL PROTECTED]> wrote: Puneet Lakhina wrote: > hi, > I have the following scenario. I have a form that takes certain input. This > in effect goes through certain validations. Now what I want to do is in > case > of validation errors a seprarte page is displayed that lists all the > errors, > and asks the user to continue submitting the data ignoring the errors, > or to > go back to the form and change the data. > My question is how do i submit the data from my error page (which is a > different page), in case the user chooses to continue to submit ignoring > the > errors. > > So the flow is like this > > form submit-> if errors - >error page - >if continue ->submit data and > store > in Database. > > This continue functionality is what im unable to achieve because I dont > know > how to resubmit the same form values from the error page. > > Any clues?? I can think of at least two ways to do this: 1) use session scope for your form bean; wheter the user decides to return and re-edit his data, or submit it, the data is still in the session-scoped form Thats what I did. Is that a good thing to do?? 2) if you want to avoid using the session, you could serialize the submitted data as hidden fields in the error page; then the user submits that page, their inputs will be re-submitted from the hidden fields, and thus available to the next action Thought of this..but wouldnt that make code maintanence a problem. I mean i add a field to the old form..n il have to add it here..n so on... what do you think?? There are probably other approaches too, but that should at least give you a starting point. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] thanks -- Puneet
Re: Retain Form Bean
Puneet Lakhina wrote: hi, I have the following scenario. I have a form that takes certain input. This in effect goes through certain validations. Now what I want to do is in case of validation errors a seprarte page is displayed that lists all the errors, and asks the user to continue submitting the data ignoring the errors, or to go back to the form and change the data. My question is how do i submit the data from my error page (which is a different page), in case the user chooses to continue to submit ignoring the errors. So the flow is like this form submit-> if errors - >error page - >if continue ->submit data and store in Database. This continue functionality is what im unable to achieve because I dont know how to resubmit the same form values from the error page. Any clues?? I can think of at least two ways to do this: 1) use session scope for your form bean; wheter the user decides to return and re-edit his data, or submit it, the data is still in the session-scoped form 2) if you want to avoid using the session, you could serialize the submitted data as hidden fields in the error page; then the user submits that page, their inputs will be re-submitted from the hidden fields, and thus available to the next action There are probably other approaches too, but that should at least give you a starting point. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Retain Form Bean
hi, I have the following scenario. I have a form that takes certain input. This in effect goes through certain validations. Now what I want to do is in case of validation errors a seprarte page is displayed that lists all the errors, and asks the user to continue submitting the data ignoring the errors, or to go back to the form and change the data. My question is how do i submit the data from my error page (which is a different page), in case the user chooses to continue to submit ignoring the errors. So the flow is like this form submit-> if errors - >error page - >if continue ->submit data and store in Database. This continue functionality is what im unable to achieve because I dont know how to resubmit the same form values from the error page. Any clues?? -- Puneet
Re: form bean with composition, is it possible?
public class MyForm extends ValidatorForm { CreditCard getCreditCard() } CreditCard has to be a bean, jsp. Regards On 10/25/06, xianwinwin <[EMAIL PROTECTED]> wrote: Hi guys, I wonder if it's possible to create a form bean with a composition. I mean, assuming I have the following classes: AccountInformation ( fname, lname...) CreditCard (number, type...) I would like to know if I can create a form (registration) that is composed from AccountInformation and CreditCard??? I don't want to retype all properties again (doesn't sound right) my question is this: 1. is it possible to do that? 2. if yes, how would the registration.jsp page will look like? If it was a regular form, it would have been: thanks for any advise. -- View this message in context: http://www.nabble.com/form-bean-with-composition%2C-is-it-possible--tf2505462.html#a6985533 Sent from the Struts - User mailing list archive at Nabble.com. -- Yujun Liang [EMAIL PROTECTED]
form bean with composition, is it possible?
Hi guys, I wonder if it's possible to create a form bean with a composition. I mean, assuming I have the following classes: AccountInformation ( fname, lname...) CreditCard (number, type...) I would like to know if I can create a form (registration) that is composed from AccountInformation and CreditCard??? I don't want to retype all properties again (doesn't sound right) my question is this: 1. is it possible to do that? 2. if yes, how would the registration.jsp page will look like? If it was a regular form, it would have been: thanks for any advise. -- View this message in context: http://www.nabble.com/form-bean-with-composition%2C-is-it-possible--tf2505462.html#a6985533 Sent from the Struts - User mailing list archive at Nabble.com.
RE: html form instantiating form bean
From: Puneet Lakhina [mailto:[EMAIL PROTECTED] > On 10/11/06, Ed Griebel <[EMAIL PROTECTED]> wrote: > > You should not instantiate manually your own formbean nor put it into > > the request scope, you must use the formbean passed into your action > > class via the ActionForm object. > Ok I think my question isnt clear. > > So basically PrepareAction has a different form bean associated with it > than formBeanName. formBeanName is associated with SubmitAction and not > PrepareAction. Hence typecasting wont work. It's not that your question isn't clear, it's that you're doing it wrong. Why would PrepareAction have a formbean of a different class if you're putting it in to scope and expecting it to work in SubmitAction? If you have two Actions that show the same JSP the 'name' attribute in the action mapping should point to the same bean, hence the same class. Otherwise wouldn't your JSP break (in general)? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html form instantiating form bean
On 10/11/06, Ed Griebel <[EMAIL PROTECTED]> wrote: You should not instantiate manually your own formbean nor put it into the request scope, you must use the formbean passed into your action class via the ActionForm object. Ok I think my question isnt clear. I have two action classes PrepareAction and SubmitAction. I have one page submitInputPage.jsp The formBeanName is associated with SubmitAction. So what the PrepareAction is looking to do is create a formBeanObject and put it in request scope and forward to the submitInputPage.jsp. So basically PrepareAction has a different form bean associated with it than formBeanName. formBeanName is associated with SubmitAction and not PrepareAction. Hence typecasting wont work. When you get the handle to the formbean you can either cast the formbean to it's real class or you can use BeanUtils.populate(formbean, "param_1", value1) to get your values into the formbean. Hopefully I have not missed the point of your question. HTH, -ed On 10/11/06, Puneet Lakhina <[EMAIL PROTECTED]> wrote: > Hi, > This has to be one of the most bewildering thing I have faced in my 3 months > of learning struts. > Now I have an action(PreapreAction) which I use to prepare a page for > display. This for fetches values from a Database and creates an instance of > the formbean and puts values into the form bean. Now i do > request.setAttribute("formBeanName",formBeanObject). And then forwards to > the page which has something like this > > > .. > > > the fooAction has formBeanName as its form bean defined in the struts > config. But Im not able to get any values into the fields in my form. > > However if I do this > . It prints the > correct value i.e. the value that I set in the PrepareAction. Does this mean > that there are two form bean in the request scope. but theere cant be two > attributes with the same name. > > So i printed all the attribute names and their class in my jsp page. > Turns out there is another attribute of type formBeanObject in my request > under the key org.apache.struts.taglib.html.BEAN > > Why is this happening?? I even tried using they key > org.apache.struts.taglib.html.BEAN in my PrepareAction but still ti does not > work. > > SO i printed a message from the default constructor of my form bean. Thats > printed twice, once when i instantiate it in PrepareAction and again when > the page is loaded. > > Plz plz help me sort this out. > > -- > Puneet > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Puneet
RE: html form instantiating form bean
From: Puneet Lakhina [mailto:[EMAIL PROTECTED] > The prepare action needs to prepopulate values into the form that is > displayed subsequently. How else can i do this?? Populating a form is different than instantiating one and putting it in to scope: Struts1 already instantiates and scopes forms. If you have configured your actions properly the form passed to the execute method can either be used as-is via BeanUtils.populate (etc.) or cast (i.e., to a form class you created) and populated. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html form instantiating form bean
You should not instantiate manually your own formbean nor put it into the request scope, you must use the formbean passed into your action class via the ActionForm object. When you get the handle to the formbean you can either cast the formbean to it's real class or you can use BeanUtils.populate(formbean, "param_1", value1) to get your values into the formbean. Hopefully I have not missed the point of your question. HTH, -ed On 10/11/06, Puneet Lakhina <[EMAIL PROTECTED]> wrote: Hi, This has to be one of the most bewildering thing I have faced in my 3 months of learning struts. Now I have an action(PreapreAction) which I use to prepare a page for display. This for fetches values from a Database and creates an instance of the formbean and puts values into the form bean. Now i do request.setAttribute("formBeanName",formBeanObject). And then forwards to the page which has something like this .. the fooAction has formBeanName as its form bean defined in the struts config. But Im not able to get any values into the fields in my form. However if I do this . It prints the correct value i.e. the value that I set in the PrepareAction. Does this mean that there are two form bean in the request scope. but theere cant be two attributes with the same name. So i printed all the attribute names and their class in my jsp page. Turns out there is another attribute of type formBeanObject in my request under the key org.apache.struts.taglib.html.BEAN Why is this happening?? I even tried using they key org.apache.struts.taglib.html.BEAN in my PrepareAction but still ti does not work. SO i printed a message from the default constructor of my form bean. Thats printed twice, once when i instantiate it in PrepareAction and again when the page is loaded. Plz plz help me sort this out. -- Puneet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html form instantiating form bean
On 10/11/06, Dave Newton <[EMAIL PROTECTED]> wrote: From: Puneet Lakhina [mailto:[EMAIL PROTECTED] > the fooAction has formBeanName as its form bean defined in the struts > config. But Im not able to get any values into the fields in my form. Why are you doing this manually? If you have configured your actions properly the framework will do this bit of work for you. I am sorry but I dont understand. The prepare action needs to prepopulate values into the form that is displayed subsequently. How else can i do this?? So I printed a message from the default constructor of my form bean. Thats > printed twice, once when i instantiate it in PrepareAction and again when > the page is loaded. See? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Puneet
RE: html form instantiating form bean
From: Puneet Lakhina [mailto:[EMAIL PROTECTED] > the fooAction has formBeanName as its form bean defined in the struts > config. But Im not able to get any values into the fields in my form. Why are you doing this manually? If you have configured your actions properly the framework will do this bit of work for you. > So I printed a message from the default constructor of my form bean. Thats > printed twice, once when i instantiate it in PrepareAction and again when > the page is loaded. See? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html form instantiating form bean
Hi, This has to be one of the most bewildering thing I have faced in my 3 months of learning struts. Now I have an action(PreapreAction) which I use to prepare a page for display. This for fetches values from a Database and creates an instance of the formbean and puts values into the form bean. Now i do request.setAttribute("formBeanName",formBeanObject). And then forwards to the page which has something like this .. the fooAction has formBeanName as its form bean defined in the struts config. But Im not able to get any values into the fields in my form. However if I do this . It prints the correct value i.e. the value that I set in the PrepareAction. Does this mean that there are two form bean in the request scope. but theere cant be two attributes with the same name. So i printed all the attribute names and their class in my jsp page. Turns out there is another attribute of type formBeanObject in my request under the key org.apache.struts.taglib.html.BEAN Why is this happening?? I even tried using they key org.apache.struts.taglib.html.BEAN in my PrepareAction but still ti does not work. SO i printed a message from the default constructor of my form bean. Thats printed twice, once when i instantiate it in PrepareAction and again when the page is loaded. Plz plz help me sort this out. -- Puneet
clear form bean properties
Which method is the better/preffered way to clear the form-bean properties. have form properties as ArrayList, String and Boolean in a DynaValidatorForm. when we have to clear the form bean we are trying to remove all the form properties i.e making form-bean with no properties in it. Other way is to make all the form-properties to blank. which is better or usual way of doing? Thanks. _ Share your special moments by uploading 500 photos per month to Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form-bean is not getting updated with the values entered
It appears that the value for your paymentPropertyName is not pointing to the INDIVIDUAL property, but to the ArrayList as a whole. Try setting it to a property of the object that is in the array list. ie. payments[#].amount Be sure your form has a getPayments method as well. -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 19, 2006 9:44 AM To: user@struts.apache.org Subject: form-bean is not getting updated with the values entered Have an ArrayList in the form-bean This contains the list of row objects required for the below table. using displaytag to display the the list of elements. .. ... I tried using the above code but, when the form is submitted the values entered in the input fields are not updated to the form-bean arraylist. Using validator for validation. that seams to be working fine but the form-beans ArrayList is not updated. what am I missing here? how to fix this? Thanks. _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip - 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]
form-bean is not getting updated with the values entered
Have an ArrayList in the form-bean This contains the list of row objects required for the below table. using displaytag to display the the list of elements. requestURI="PrepareAction.do" class="table1"> .. ... I tried using the above code but, when the form is submitted the values entered in the input fields are not updated to the form-bean arraylist. Using validator for validation. that seams to be working fine but the form-beans ArrayList is not updated. what am I missing here? how to fix this? Thanks. _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set a form bean property of type HashMap in jsp
On 9/7/06, Vaneet Sharma <[EMAIL PROTECTED]> wrote: Can anybody tell me how to set a form bean property of type java.util.HashMap in a jsp page. Actually i am prepolulating this property in action and then forwarding to a jsp page. In this jsp page i need to again set this property ,so tht if there is some validation error then this HashMap is not lost. So tht is why i want to set this property of type HashMap in jsp page . If all you need to do is to copy the property you can use If your hashmap is being set as a request attribute If its a property of the form bean then, Read this for more http://struts.apache.org/1.2.x/api/org/apache/struts/taglib/bean/package-summary.html#package_description -- Puneet
How to set a form bean property of type HashMap in jsp
Can anybody tell me how to set a form bean property of type java.util.HashMap in a jsp page. Actually i am prepolulating this property in action and then forwarding to a jsp page. In this jsp page i need to again set this property ,so tht if there is some validation error then this HashMap is not lost. So tht is why i want to set this property of type HashMap in jsp page . Regards Vaneet. Sharma CRISIL. Office- (91)-22-6644 4116 M- (91)-93223 39127 Disclaimer : This message and any attachments (hereinafter referred to as the Said Information) are intended solely for the addressee. The Said Information is confidential and may be privileged and is also prohibited from disclosure. Access, use, copying, distribution or e-use of the Said Information by anyone except the addressee is unauthorized. If you are not the intended addressee, please destroy all copies of the Said Information in your possession and also delete the same from your computer. Any views expressed in the Said Information are those of the individual sender except where the sender, with due authority of CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd. specifically states them to be the views of CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd. Nothing contained in the Said Information is capable or intended to create any legally binding obligations on the sender CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India L td. who accept no responsibility, whatsoever, for loss or damage from the use of the Said Information including damage from viruses.
Re: Can I Bypass using actionform? Cannot retrieve definition for form bean null on action...
If your "type" attribute equals "org.apache.struts.actions.ForwardAction" (and there may be others) then you don't need the name attribute. You are getting that error because you are specifying a custom action and there's no associated form bean. You can use ForwardAction if you just want a URL to go straight to a JSP w/ no tweaking of the form bean needed prior to JSP rendering. -adam Mississippi John Hurt wrote: Is there some way to not use an actionform bean in your JSP. I get the error message... Cannot retrieve definition for form bean null on action when I do not include a "name=" in my struts config action. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can I Bypass using actionform? Cannot retrieve definition for form bean null on action...
Is there some way to not use an actionform bean in your JSP. I get the error message... Cannot retrieve definition for form bean null on action when I do not include a "name=" in my struts config action. Thanks.
RE: what's initial in form-bean ?
The "initial" attribute on the form-property allows you to initialize the value of the property when the form instance is created by the framework. Adam -Original Message- From: A. Lotfi [mailto:[EMAIL PROTECTED] Sent: Monday, August 28, 2006 3:15 PM To: Struts Users Mailing List Subject: what's initial in form-bean ? what initial in this form bean means ? Thanks - Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail. - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what's initial in form-bean ?
what initial in this form bean means ? Thanks - Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail.
[SOLVED] Re: Auto render form bean as hidden fields
In case anyone's curious, here's the synopsis of my solution: - Manually annotate (Java 1.5) the private fields I want to "track". - Have a base class that stores the original state (when a record is first loaded from the database, for editing, for example). - Write a class that walks through the annotated fields, getting their type from attributes (types are things like simple--hidden,text,etc--nested, or mapped), and writes type="hidden"...> tags for each one. - Make a tag library to output the JS (exporting page context variables is a magical thing indeed) for checking for changes. - Unit test for a few days :) The tricky part was the map-based nested beans. The easy part was outputting the tags. The hard part was realizing that BeanUtils.cloneBean does a shallow copy of Maps. Fortunately, the code that walked through the annotations was also able to deep-copy the bean. - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Auto render form bean as hidden fields
Laurie Harper wrote: Scott Van Wart wrote: We have a requirement that the user be prompted if any changes have been made on a form, and they try to navigate away. I've divided this up Firstly, is the requirement to detect changes to the form compared to how it was last rendered, or compared to how it was *originally* rendered? I.e. do you have to be able to detect a difference in form state across multiple requests? Originally rendered. I need to render the hidden fields because it's a multi-user system, and I have other mechanisms that maintain concurrency--so by passing the fields back and forth as hidden, the process doesn't get disrupted by someone else changing it in the background (I can use my other methods of notifying the user that this has happened). Even then, all you really need is a Javascript object containing key/value pairs describing each form property's starting value. You shouldn't need to worry about server-side data types, collections, or anything else; just 'form field X has value Y'. There are a few things I need to worry about by design: - Child items listed on a page, and their order. - Multi-select dropdowns. - Multiple checkboxes (this one actually wasn't as difficult as I thought it was going to be). - Map-based nested beans (someForm.someChild(4).whatever--ahh, a simple key=value? Nope, whatever is a multi-checkbox). Right now I'm halfway through my implementation of generating a lot of stuff myself. Rather than using beanutils, I just add a @NavPrompt annotation to each private member of my ActionForm that I want to track. I've implemented basic ones (where I can just do document.form.whatever.value != "..."), multi-selects (with a helper method), multi-checkboxes (with a helper method), but I still need to do nested beans and map-based beans. I decided to do it this way rather than simple key/value pairs to keep the JavaScript as simple as possible. It's also possible that with better knowledge of JavaScript I could reduce the amount of framework I need to write on the server, but writing Java code is far more fun than learning--let alone writing--JavaScript IMHO :). Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]