Re: Problem with Data Source Definition
Am Dienstag, 20. April 2004 08:53 schrieb Xuemin Guan: Tomcat (5.0.19) comes together with commons-pool-1.1.jar, which is under CALINA_HOME/common/lib. This directory is both seen by container and you web applications. So, I guess the problem is not cause by the lack of commons-pool-1.1.jar. Am I missing anything here? Exactly, commons-pool-1.1.jar as well as commons-dbcp-1.1.jar are located in CATALINE_HOME/common/lib and I added them as external JARs to the build path of the project. So I guess it should be found by the application. Is there a way to get a more detailed information about what's going wrong during startup? The displayed message StandardContext[/demo_03]Servlet /demo_03 threw load() exception javax.servlet.UnavailableException: Initializing application data source local_01 at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1091) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:256) does not really help to fix this problem. Probably, the problem might be one of the properties. I took them from the example from the Struts HowTo on accessing databases. Any ideas? Best regards, Ralf. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Data Source Definition
I don't know the cause of this problem. I set up the datasource inforamtion in both Tomcat's server.xml and the application specific web.xml rather than in struts-config.xml, and I have no problem. The regarding part in the server.xml: Resource name=jdbc/LocalNesSQLServer scope=Shareable type=javax.sql.DataSource auth=Container description=The Nes SQLServer Database residing on machine, 192.168.8.136 /Resource ResourceParams name=jdbc/LocalNesSQLServer parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://localhost:1433;databaseName=nes;SelectMeth od=cursor/value /parameter parameter nameusername/name valuenesuser/value /parameter parameter namepassword/name valuepassword/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your DB max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value100/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value30/value /parameter /ResourceParams The conserning part in my web.xml: resource-ref res-ref-namejdbc/LocalNesSQLServer/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Alternatively, please read http://lin.kz/?b6v00 Best, Xuemin Am Dienstag, 20. April 2004 08:53 schrieb Xuemin Guan: Tomcat (5.0.19) comes together with commons-pool-1.1.jar, which is under CALINA_HOME/common/lib. This directory is both seen by container and you web applications. So, I guess the problem is not cause by the lack of commons-pool-1.1.jar. Am I missing anything here? Exactly, commons-pool-1.1.jar as well as commons-dbcp-1.1.jar are located in CATALINE_HOME/common/lib and I added them as external JARs to the build path of the project. So I guess it should be found by the application. Is there a way to get a more detailed information about what's going wrong during startup? The displayed message StandardContext[/demo_03]Servlet /demo_03 threw load() exception javax.servlet.UnavailableException: Initializing application data source local_01 at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.j ava:1091) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) at javax.servlet.GenericServlet.init(GenericServlet.java:256) does not really help to fix this problem. Probably, the problem might be one of the properties. I took them from the example from the Struts HowTo on accessing databases. Any ideas? Best regards, Ralf. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:checkbox
Hi, The problem is, when the checkbox is unchecked, the value passed is null and not false. So in the action class you should check if the form bean checbox property is null...then set it to false explicitly. Regards Rajani -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:53 PM To: 'Struts Users Mailing List' Subject: Problem with html:checkbox Hi All, I have a JSP with the following: html:checkbox name=%=formBean% property=regulated value=truebean:message key=product.prompt.regulated//html:checkboxnbsp; html:checkbox name=%=formBean% property=certRequired value=truebean:message key=product.prompt.cert_required//html:checkbox The problem is this: The appropriate Form Bean setters are called when setting the checkboxes (i.e. when ticking them), but not with unsetting them and I can't seem to figure out why. The setters/getters in Form Bean take and return 'boolean'. Does anyone have any thoughts on this? Many thanks in advance. Kind regards, -- Marc - 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]
Tiles
Hi all, I am using Tiles in my Main page : tiles:insert page=AcceuilTemplate.jsp tiles:put name=head value=templates/Head.jsp / tiles:put name=entete value=templates/entete.jsp / tiles:put name=foot value=templates/Foot.jsp / tiles:put name=navi value=templates/Navi.jsp / tiles:put name=content value=SaisiPB.jsp / /tiles:insert The page Navi.jsp contains the following code : layout:menuItem key=menu1 layout:menuItem key=menu1.submenu1 link=/PROJECT/MainAction.do / layout:menuItem key=menu1.submenu2 link=/PROJECT/UpdatePBAction.do / layout:menuItem key=menu1.submenu3 link=/PROJECT/html/entete.html / /layout:menuItem PB : When I click to the link the forwarded page is displayed lonly in the window What I want is to display the page in the content of tiles, and the 'Foot', 'Navi' must be displayed. Thanks
RE: Creating an indexed property of DynaActionForms
Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:checkbox
Hmmm... That is interesting because I was always under the assumption that the setter is never called when there is no value and the only read world use of reset() is to set checkboxes to false? Am I wrong? sandeep -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:51 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox Brilliant. Thanks for the help. Kind regards, -- Marc -Original Message- From: Rajani [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 09:43 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Problem with html:checkbox Hi, The problem is, when the checkbox is unchecked, the value passed is null and not false. So in the action class you should check if the form bean checbox property is null...then set it to false explicitly. Regards Rajani -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:53 PM To: 'Struts Users Mailing List' Subject: Problem with html:checkbox Hi All, I have a JSP with the following: html:checkbox name=%=formBean% property=regulated value=truebean:message key=product.prompt.regulated//html:checkboxnbsp; html:checkbox name=%=formBean% property=certRequired value=truebean:message key=product.prompt.cert_required//html:checkbox The problem is this: The appropriate Form Bean setters are called when setting the checkboxes (i.e. when ticking them), but not with unsetting them and I can't seem to figure out why. The setters/getters in Form Bean take and return 'boolean'. Does anyone have any thoughts on this? Many thanks in advance. Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:checkbox
And what happens when you are using a DispatchAction and a session scoped form? If you are in a wizard use case, where you go forwards and backwards in a screen sequence using Dispatch action and session scoped form, if in the first screen you set the checkbox on and then you want to go back and unset it, you should check in the request.getParameter() if it is null to set it to false (according to Rajani's reply), because the ActionForm getter for the boolean property won't be populated. Am I right? Should it be placed in thge reset method of that ActionForm? -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Miércoles, 21 de Abril de 2004 09:11 a.m. To: Struts Users Mailing List Subject: RE: Problem with html:checkbox Hmmm... That is interesting because I was always under the assumption that the setter is never called when there is no value and the only read world use of reset() is to set checkboxes to false? Am I wrong? sandeep -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:51 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox Brilliant. Thanks for the help. Kind regards, -- Marc -Original Message- From: Rajani [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 09:43 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Problem with html:checkbox Hi, The problem is, when the checkbox is unchecked, the value passed is null and not false. So in the action class you should check if the form bean checbox property is null...then set it to false explicitly. Regards Rajani -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:53 PM To: 'Struts Users Mailing List' Subject: Problem with html:checkbox Hi All, I have a JSP with the following: html:checkbox name=%=formBean% property=regulated value=truebean:message key=product.prompt.regulated//html:checkboxnbsp; html:checkbox name=%=formBean% property=certRequired value=truebean:message key=product.prompt.cert_required//html:checkbox The problem is this: The appropriate Form Bean setters are called when setting the checkboxes (i.e. when ticking them), but not with unsetting them and I can't seem to figure out why. The setters/getters in Form Bean take and return 'boolean'. Does anyone have any thoughts on this? Many thanks in advance. Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic Generation of HTML Form Element in Struts
Hi U can generate Dynaaction elements struts-config.xml file. For eg: form-bean name= type= form-property name=firstname type=java.lang.String/ /form-bean urs Ganesh - Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢
Validation with 2 masks?
I'd like to a property validation against 2 different regular expressions with 2 different error messages. This seems like a fairly common use. Is there a best practice for it? Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Jbuilder 9 Changing Stuts 1.0 to 1.1
I use JBuilder 8 with Struts 1.1 and no real problems (okay, you need to make it forget 1.0 exists or it will try to put back the wrong dtd's in your WEB-INF directory when you startup). Look at the JBuilder defintion for the Struts Library under Configure Libraries, you want to make a 1.1. version just like it, this includes telling where the struts tld's are. For JBuilder 8, I needed to tell it it was a custom framework, and NOT a Struts framework because it would make assumptions that were 1.0 related (i.e. a template tld, but no tiles tld, etc). Declare your project to use this library. Copy the TLD's into the WEB-INF directory like JB wants, and it should work fine. Did for me anyway. -Original Message- From: Ramil Mirhasanov [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:25 AM To: Struts Users Mailing List Subject: Re: Jbuilder 9 Changing Stuts 1.0 to 1.1 Thanks for a reply, but I still have not solved my problem. After I moved all library files, just like you said. I tried to change my struts-config.dtd But encountered with the following parser error: Parse Fatal Error at line 4 column -1: External entity not found: http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;. When I compile with stuts-config_1_0.dtd, it compiles: register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'jar:file:D:/Dev/Devweb/test/strutswebapp/WEB-INF/lib/struts.j ar!/org/apache /struts/resources/struts-config_1_0.dtd' But this time it does not support the tags of struts-config_1_1.dtd. thanks again! Ramil - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:30 PM Subject: RE: Jbuilder 9 Changing Stuts 1.0 to 1.1 Yes it - is. I use Jbuilder 9 and struts 1.1 You need to manually configure it: - Add 2 new libraries through Tools/Configure Libraries - call one Struts 1.1 and the other Struts 1.1 JSTL - For Struts 1.1 JSTL - add classes %strutsdir%/contrib/struts-el/lib/jstl.jar and %strutsdir%/contrib/struts-el/lib/standard.jar - Framework- choose JSTL and define all libraries eg core (EL) prefix c, core (RT) prefix c_rt - For Struts 1.1 - add classes commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-fileupload.jar, commons-lang.jar, commons-validator.jar, jakarta-oro.jar, struts.jar, struts-el.jar all from %strutsdir%/contrib - Framework - choose Struts and define all the tag libraries - Required libraries - Struts JSTL 1.1 -Original Message- From: Ramil Mirhasanov [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 11:15 To: [EMAIL PROTECTED] Subject: Jbuilder 9 Changing Stuts 1.0 to 1.1 Hi, I am using J Builder 9 for web development. It has built-in Struts 1.0. Is it possible to change it to struts 1.1 version. I tried changing the struts.jar file in thirdparty/jakarta-struts-1.0.2. But it doesnt work properly. My problem is the error given: Parse Error at line 7 column -1: Element form-bean does not allow form-property here. org.xml.sax.SAXParseException: Element form-bean does not allow form-property here. in my struts-congig.xml: form-beans form-bean name=radioForm type=org.apache.struts.action.DynaActionForm form-property name=control type=java.lang.String[]/ /form-bean form-bean name=girisActionForm type=dxwd02.forms.GirisActionForm / /form-beans Thanks for help. Regards, Ramil -- -- For more information about Barclays Capital, please visit our web site at http://www.barcap.com. Internet communications are not secure and therefore the Barclays Group does not accept legal responsibility for the contents of this message. Although the Barclays Group operates anti-virus programmes, it does not accept responsibility for any damage whatsoever that is caused by viruses being passed. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Barclays Group. Replies to this email may be monitored by the Barclays Group for operational or business reasons. -- -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:checkbox
I think reset because you may change validation at some point as well. reset - populate - validate - action. sandeep -Original Message- From: Guillermo Meyer [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:15 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox And what happens when you are using a DispatchAction and a session scoped form? If you are in a wizard use case, where you go forwards and backwards in a screen sequence using Dispatch action and session scoped form, if in the first screen you set the checkbox on and then you want to go back and unset it, you should check in the request.getParameter() if it is null to set it to false (according to Rajani's reply), because the ActionForm getter for the boolean property won't be populated. Am I right? Should it be placed in thge reset method of that ActionForm? -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Miércoles, 21 de Abril de 2004 09:11 a.m. To: Struts Users Mailing List Subject: RE: Problem with html:checkbox Hmmm... That is interesting because I was always under the assumption that the setter is never called when there is no value and the only read world use of reset() is to set checkboxes to false? Am I wrong? sandeep -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:51 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox Brilliant. Thanks for the help. Kind regards, -- Marc -Original Message- From: Rajani [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 09:43 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Problem with html:checkbox Hi, The problem is, when the checkbox is unchecked, the value passed is null and not false. So in the action class you should check if the form bean checbox property is null...then set it to false explicitly. Regards Rajani -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:53 PM To: 'Struts Users Mailing List' Subject: Problem with html:checkbox Hi All, I have a JSP with the following: html:checkbox name=%=formBean% property=regulated value=truebean:message key=product.prompt.regulated//html:checkboxnbsp; html:checkbox name=%=formBean% property=certRequired value=truebean:message key=product.prompt.cert_required//html:checkbox The problem is this: The appropriate Form Bean setters are called when setting the checkboxes (i.e. when ticking them), but not with unsetting them and I can't seem to figure out why. The setters/getters in Form Bean take and return 'boolean'. Does anyone have any thoughts on this? Many thanks in advance. Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with html:checkbox
What I had to do is to read the parameter out of the request. If the parameter is there, the value is 'true' and I call the setter to set the value to 'true'. If the parameter does not exist (the request.getParameter(...) returns null) then I call the setter and set the value to 'false'. On wizard type forms, I have a method which holds the values which were originally used to populate the form. For instance I read an row for the the database, my business delegate hands me a value object. This value object I store in the form bean. Should the user select and I use can use the to 'reset' the form to the original values. Kind regards, -- Marc -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 14:29 To: Struts Users Mailing List Subject: RE: Problem with html:checkbox I think reset because you may change validation at some point as well. reset - populate - validate - action. sandeep -Original Message- From: Guillermo Meyer [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:15 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox And what happens when you are using a DispatchAction and a session scoped form? If you are in a wizard use case, where you go forwards and backwards in a screen sequence using Dispatch action and session scoped form, if in the first screen you set the checkbox on and then you want to go back and unset it, you should check in the request.getParameter() if it is null to set it to false (according to Rajani's reply), because the ActionForm getter for the boolean property won't be populated. Am I right? Should it be placed in thge reset method of that ActionForm? -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Miércoles, 21 de Abril de 2004 09:11 a.m. To: Struts Users Mailing List Subject: RE: Problem with html:checkbox Hmmm... That is interesting because I was always under the assumption that the setter is never called when there is no value and the only read world use of reset() is to set checkboxes to false? Am I wrong? sandeep -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:51 AM To: 'Struts Users Mailing List' Subject: RE: Problem with html:checkbox Brilliant. Thanks for the help. Kind regards, -- Marc -Original Message- From: Rajani [mailto:[EMAIL PROTECTED] Sent: 21 April 2004 09:43 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Problem with html:checkbox Hi, The problem is, when the checkbox is unchecked, the value passed is null and not false. So in the action class you should check if the form bean checbox property is null...then set it to false explicitly. Regards Rajani -Original Message- From: Marc L. Veary [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:53 PM To: 'Struts Users Mailing List' Subject: Problem with html:checkbox Hi All, I have a JSP with the following: html:checkbox name=%=formBean% property=regulated value=truebean:message key=product.prompt.regulated//html:checkboxnbsp; html:checkbox name=%=formBean% property=certRequired value=truebean:message key=product.prompt.cert_required//html:checkbox The problem is this: The appropriate Form Bean setters are called when setting the checkboxes (i.e. when ticking them), but not with unsetting them and I can't seem to figure out why. The setters/getters in Form Bean take and return 'boolean'. Does anyone have any thoughts on this? Many thanks in advance. Kind regards, -- Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo,
execute() method running twice
Hi there .. :-) Wonder if anyone could help me with a strange problem I can't seem to solve. I have a form tied to an Action. The form is submitted through a Javascript call from the JSP page. I was getting some strange behaviour, so I added a bit of debug code, and discovered that the execute() method in the action is being called twice each time the form is submitted. Has anyone come across this before? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: execute() method running twice
Hi, I had the same one last year. The solution was: I had a table tag with background attribute and this contains a #. If I had remove this, the action will not executed twice. Pherhaps it's help you. Regards, Frank -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 21. April 2004 16:21 An: [EMAIL PROTECTED] Betreff: execute() method running twice Hi there .. :-) Wonder if anyone could help me with a strange problem I can't seem to solve. I have a form tied to an Action. The form is submitted through a Javascript call from the JSP page. I was getting some strange behaviour, so I added a bit of debug code, and discovered that the execute() method in the action is being called twice each time the form is submitted. Has anyone come across this before? - 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]
Action - nothing
I was wondering if there's any chance to create an action that do some processing and then return to the same page it was called. Thanks, Julio
RE: Action - nothing
Just create an action. The first time the action is called have it do: return (mapping.findForward(display)); In the jsp code, when you specify the form tag do: html:form action=/myAction?action=process It will then go back to the original form with a parameter added: String action = request.getParameter(action); If (action != null action.equals(process)){ //Do Stuff return (mapping.findForward(display)); } -- Nathan -Original Message- From: Julio Cesar De Salvo [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:55 AM To: 'Struts Users Mailing List' Subject: Action - nothing I was wondering if there's any chance to create an action that do some processing and then return to the same page it was called. Thanks, Julio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
I take it then that there is no way to use normal DynaActionForms. It would certainly be a lot simpler. :( Nathan -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:message in %include not working
Hi All: When I use %@ include file='bean:message key=test.file' %, the bean tag doesn't seem to pull the corresponding resource from the App.Resource file. Instead, its looking for a file bean:message and spitting out an error saying File Not Found. Am I missing any fundamental stuff here? I tried using jsp:include file= Also, tried various combination of single and double quotes. But nada. It picks the file name as such in '' I'm sure I'm including the correponding TLD (struts-beans) in the page. I appreciate any help. Thanks, Pani Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate over a collection of non-simple objects, how to fill them after submit
Did I forget the ??? in the subject line so that no one answers? Lachdanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Non-Form Based Mapped Properties
Is there a way to use non-form based mapped and indexed properties with bean and/or html tags? Apparently not? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:message in %include not working
HI pani, pls go through the this.. i think it will help %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % jsp:useBean id=bean class=org.apache.struts.webapp.exercise.StringBean/ bean:write name=bean property=labelValue[1].label/ Bye, Jbalaji Pani R [EMAIL PROTECTED] wrote: Hi All: When I use ' %, the tag doesn't seem to pull the corresponding resource from the App.Resource file. Instead, its looking for a file I tried using . Also, tried various combination of single and double quotes. But nada. It picks the file name as such in '' I'm sure I'm including the correponding TLD (struts-beans) in the page. I appreciate any help. Thanks, Pani Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢
Re: bean:message in %include not working
Try something like this: bean:define id='myFile'bean:message key=test.file//bean:define jsp:include file=%=myFile%/ Pani R wrote: Hi All: When I use %@ include file='bean:message key=test.file' %, the bean tag doesn't seem to pull the corresponding resource from the App.Resource file. Instead, its looking for a file bean:message and spitting out an error saying File Not Found. Am I missing any fundamental stuff here? I tried using jsp:include file= Also, tried various combination of single and double quotes. But nada. It picks the file name as such in '' I'm sure I'm including the correponding TLD (struts-beans) in the page. I appreciate any help. Thanks, Pani Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate over a collection of non-simple objects, how to fill them after submit
What *exactly* is your question ? Is only the subject of your e-mail ? Lachdanan wrote: Did I forget the ??? in the subject line so that no one answers? Lachdanan - 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]
iterate through a HashMap of Integer[]'s
myBean contains a property myHashMap myHashMap contains Integer[]'s as values I would like to figure out how to iterate through myHashMap and write each Integer from each Integer[] I have the following but since the Integer[] is not a bean or a property of a bean, I can't figure out how to reference it or it's values. logic:iterate id=bean1 name=myBean property=myHashMap logic:iterate id=bean2 name=bean1 property=Integer[] indexId=i bean:write property=Integer[${i}]/ /logic:iterate /logic:iterate thanks for your help in advance.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:message in %include not working
Thank You! It works. - Pani -- - Original Message - DATE: Wed, 21 Apr 2004 12:53:15 From: Daniel Henrique Alves Lima [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Cc: Try something like this: bean:define id='myFile'bean:message key=test.file//bean:define jsp:include file=%=myFile%/ Pani R wrote: Hi All: When I use %@ include file='bean:message key=test.file' %, the bean tag doesn't seem to pull the corresponding resource from the App.Resource file. Instead, its looking for a file bean:message and spitting out an error saying File Not Found. Am I missing any fundamental stuff here? I tried using jsp:include file= Also, tried various combination of single and double quotes. But nada. It picks the file name as such in '' I'm sure I'm including the correponding TLD (struts-beans) in the page. I appreciate any help. Thanks, Pani Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - 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] Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: iterate through a HashMap of Integer[]'s
Have you tried something like this : logic:iterate id=bean2 name=myBean property=myHashMap bean:write name=bean2/ /logic:iterate If your property hashmap is a hashMap that contains a key myInts with the value Integer [] try this: logic:iterate id=bean2 name=myBean property=myHashMap(myInts) bean:write name=bean2/ /logic:iterate news.gmane.org wrote: myBean contains a property myHashMap myHashMap contains Integer[]'s as values I would like to figure out how to iterate through myHashMap and write each Integer from each Integer[] I have the following but since the Integer[] is not a bean or a property of a bean, I can't figure out how to reference it or it's values. logic:iterate id=bean1 name=myBean property=myHashMap logic:iterate id=bean2 name=bean1 property=Integer[] indexId=i bean:write property=Integer[${i}]/ /logic:iterate /logic:iterate thanks for your help in advance.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: iterate through a HashMap of Integer[]'s
When you iterate through a map you are iterating through the Set of Map.Entry values. The Map.Entry encapsulate a key-value pair. Map.Entry has a key property and a value property. In your case, the value itself is an Integer[]. Try the following: logic:iterate id=mapEntry name=myBean property=myHashMap logic:iterate id=intValue name=mapEntry property=value bean:write name=intValue/ /logic:iterate /logic:iterate Bill Siggelkow news.gmane.org wrote: myBean contains a property myHashMap myHashMap contains Integer[]'s as values I would like to figure out how to iterate through myHashMap and write each Integer from each Integer[] I have the following but since the Integer[] is not a bean or a property of a bean, I can't figure out how to reference it or it's values. logic:iterate id=bean1 name=myBean property=myHashMap logic:iterate id=bean2 name=bean1 property=Integer[] indexId=i bean:write property=Integer[${i}]/ /logic:iterate /logic:iterate thanks for your help in advance.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:message in %include not working
if you can use tiles, usend the TileControllerClass you can include-on-the-fly any file specified in a variable. - Original Message - From: Pani R [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:05 PM Subject: bean:message in %include not working Hi All: When I use %@ include file='bean:message key=test.file' %, the bean tag doesn't seem to pull the corresponding resource from the App.Resource file. Instead, its looking for a file bean:message and spitting out an error saying File Not Found. Am I missing any fundamental stuff here? I tried using jsp:include file= Also, tried various combination of single and double quotes. But nada. It picks the file name as such in '' I'm sure I'm including the correponding TLD (struts-beans) in the page. I appreciate any help. Thanks, Pani Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
I couldn't think of one. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I take it then that there is no way to use normal DynaActionForms. It would certainly be a lot simpler. :( Nathan -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
I briefly toyed with the idea of trying to fix the flaw myself, but I looked at the struts source code and the change would not be a trivial one. -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:33 PM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I couldn't think of one. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I take it then that there is no way to use normal DynaActionForms. It would certainly be a lot simpler. :( Nathan -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
I don't think using the lazy beans is a bad approach and if you look at the code, there is very little of it. I got half way to implementing the approach, but the piece I was building was shut down so I don't know how effective it is. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:48 PM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I briefly toyed with the idea of trying to fix the flaw myself, but I looked at the struts source code and the change would not be a trivial one. -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 1:33 PM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I couldn't think of one. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms I take it then that there is no way to use normal DynaActionForms. It would certainly be a lot simpler. :( Nathan -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation with 2 masks?
I hope someone responds to this...I need the solution to this problem as well. -Original Message- From: Berke, Wayne [IT] Sent: Wednesday, April 21, 2004 9:03 AM To: Struts Users Mailing List Subject: Validation with 2 masks? I'd like to a property validation against 2 different regular expressions with 2 different error messages. This seems like a fairly common use. Is there a best practice for it? Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate over a collection of non-simple objects, how to fill them after submit
:-) No :-) plz look at my first message (first msg in this thread). When writing the second message I was a little bit frustrated that no one had answered yet! Thx in advance Lachdanan Daniel Henrique Alves Lima [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] What *exactly* is your question ? Is only the subject of your e-mail ? Lachdanan wrote: Did I forget the ??? in the subject line so that no one answers? Lachdanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav a:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating an indexed property of DynaActionForms
I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav a:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm classes. If I make the property type Object[], I can successfully populate the form, but when I try to save it, I get an ArrayOutOfBounds error when struts tries to create the initial DynaForms (Obviously because it has no idea what type of form to create, I think). How do I make this work? Also, once I start implementing validation on this form, is it going to be possible to use struts validation to validate the subitems? Thanks, Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
Re: iterate through a HashMap of Integer[]'s
thanks Bill! Bill Siggelkow [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] When you iterate through a map you are iterating through the Set of Map.Entry values. The Map.Entry encapsulate a key-value pair. Map.Entry has a key property and a value property. In your case, the value itself is an Integer[]. Try the following: logic:iterate id=mapEntry name=myBean property=myHashMap logic:iterate id=intValue name=mapEntry property=value bean:write name=intValue/ /logic:iterate /logic:iterate Bill Siggelkow news.gmane.org wrote: myBean contains a property myHashMap myHashMap contains Integer[]'s as values I would like to figure out how to iterate through myHashMap and write each Integer from each Integer[] I have the following but since the Integer[] is not a bean or a property of a bean, I can't figure out how to reference it or it's values. logic:iterate id=bean1 name=myBean property=myHashMap logic:iterate id=bean2 name=bean1 property=Integer[] indexId=i bean:write property=Integer[${i}]/ /logic:iterate /logic:iterate thanks for your help in advance.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
Lemme give an example, Lets say I have a form for Cars. The main form allows them to put in the details of the Car (make, model, year, etc). Then there is a subform to put in car parts. When you fill out the car part form, it automatically adds that car part to the list of car parts on the main form. You can then go back to the main form later, and check off the parts of the car you have, and when you hit save on the main form, it automatically saves the obtained status for each car part. Basically a Main form with a dynamically generated list of items as part of the form. It is MUCH easier to save these records to the database if everything is represented as DynaForms. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:27 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav a:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which allows you to keep things request scope when using arrays. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=java.util.ArrayList/ form-property name=subForm2 type=java.util.ArrayList/ /form-bean Unfortunately I haven't tried this, but am pretty sure it works. sandeep -Original Message- From: Nathan Ewing [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Creating an indexed property of DynaActionForms I'm trying to figure out how to define and use a DynaActionForm which has an indexed property that is another DynaActionForm. I'm using struts 1.1. Here is something like what I mean: First my sample struts-config.xml -- form-bean name=SubForm type=org.apache.struts.validator.DynaValidatorForm form-property name=property1 type=java.lang.String/ form-property name=property2 type=java.lang.String/ /form-bean form-bean name=SampleMain type=org.apache.struts.validator.DynaValidatorForm form-property name=subForm1 type=SubForm[]/ form-property name=subForm2 type=SubForm[]/ /form-bean And the JSP: -- table c:forEach var=subForm1 items=${SampleMain.map.subForm1} varStatus=status tr tdhtml:text property=subForm1[${status.index}].property1 size=5 / tdhtml:text property=subForm1[${status.index}].property2 size=5 / /tr /c:forEach /table Unfortunately this doesn't work. If I try making the subtypes SubForm[] like above, I get a NullPointer exception when I try to start the server, when struts tries to create the DynaForm
Re: logic:iterate over a collection of non-simple objects, how to fill them after submit
If your form is session scoped then the collection of beans will exist when your form is submitted back. For request scope, which I presume you are using, then you will need to generate your collection of beans. Theres been quite a bit of discussion on this list about how to do this - with a number of people using a LizyList class from Commons collections. http://cvs.apache.org/viewcvs.cgi/jakarta-commons/collections/src/java/org/apache/commons/collections/list/LazyList.java Also the LazyValidatorForm I wrote caters for this - take a look at the get(String name, int index) method in LazyValidatorForm for an example of what you need to do http://www.niallp.pwp.blueyonder.co.uk Niall - Original Message - From: Lachdanan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 19, 2004 4:52 PM Subject: logic:iterate over a collection of non-simple objects, how to fill them after submit Hello, I have the following problem: I use a collection of objects of type AClass which have another collection as an attribute (%=anAttribute[+index.intValue()+]%). logic:iterate id=ABean type=de.abc.test.AClass name=AForm property=aCollection indexId=index TR TD html:select name=ABean property='%=anAttribute[+index.intValue()+]%' size=1 html:options name=AForm property=anIDList labelProperty=aNameList/ /html:select /TD /TR /logic:iterate The direction Form -- JSP works well. In my opinion, after SUBMIT Struts should do the following: create some instances of ABean fill them with 'setAnAttribute[index]' create a collection fill it with the ABean Instances call AForm.setACollection(collection) But this doesnt work, and when I look at the HTML source code it seems that Struts forgets the ABean and tries to call AForm.setAnAttribute(value, index) which wont work of course. Does anyone have some good advice for me? Thx in advance!! Lachdanan P.S. I tried to use html:select name=ABean property=anAttribute size=1 indexed=true but that didnt work? Any ideas why not? I thought Struts would create 'property=anAttribute[index]' or similar?! Hmm, is it possible that it doesnt work because the method signature is getAnAttribute(int) instead of getAnAttribute(Integer)?? I'll try in the meantime :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation with 2 masks?
And if you want to do a javascript validation on it as well, don't forget to set the var-jstype attribute to be regexp in the validation.xml. Not that I struggled with that problem for a week or anything... Matt - Original Message - From: Niall Pemberton [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:23 PM Subject: Re: Validation with 2 masks? Theres nothing in the standard mask validation that ships with struts that allows you to do this, but it would be pretty straight forward to write and configure your own validator to do this. Set up a static mehtod somewhere that does pretty much what the FieldChecks.validateMask() method does, except modify the variable name to something like mask2 public static boolean validateMask(Object bean, ValidatorAction va, Field field, ActionMessages errors, HttpServletRequest request) { String mask = field.getVarValue(mask2); String value = null; if (isString(bean)) { value = (String) bean; } else { value = ValidatorUtils.getValueAsString(bean, field.getProperty()); } try { if (!GenericValidator.isBlankOrNull(value) !GenericValidator.matchRegexp(value, mask)) { errors.add( field.getKey(), Resources.getActionMessage(request, va, field)); return false; } else { return true; } } catch (Exception e) { log.error(e.getMessage(), e); } return true; } Then change the validation-rules.xml to add the second mask validator validator name=mask2 classname=myPackage.MyFieldChecks method=validateMask methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest depends= msg=errors.mask2/ Then in your validation.xml, use both the standard mask and your mask2 validator: form name= field property=... depends=mask, mask var var-namemask/var-namevar-value^...$/var-value /var var var-namemask2/var-namevar-value^...$/var-value /var /field - Original Message - From: Berke, Wayne [IT] [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 2:03 PM Subject: Validation with 2 masks? I'd like to a property validation against 2 different regular expressions with 2 different error messages. This seems like a fairly common use. Is there a best practice for it? Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
Let me rephrase :) its MUCH easier to save these records to the database if everything is represented as DynaBeans That would be what I meant to say :) I'm writing the Actions separately, they are not Dyna-anything. I defined all my beans as DynaBeans in the struts-config.xml file, and I wrote some code that allows me to make one call to save a dynabean straight to my database, which I call in my Action. Where I'm running into trouble is when I want to embed one dynabean inside another (like my example below, where I want to write to multiple database records off the same form). How could I make this work? Writing regular non-dynbeans would multiply maintenance incredibly. Nathan -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:08 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms DynaActionForm is an ActionForm that implements the DynaBean interface. I would understand if you said its MUCH easier to save these records to the database if everything is represented as DynaBeans, but not DynaForms - why would you need it to be an ActioForm as well as a DynaBean and not just a DynaBean. Its the implementation of the DynaBean interface in DynaActioForm that makes it Dyna, the ActionForm bit is just for struts. The lazy stuff I wrote caters for exactly the scenario you talk about, but with DynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 9:44 PM Subject: RE: Creating an indexed property of DynaActionForms Lemme give an example, Lets say I have a form for Cars. The main form allows them to put in the details of the Car (make, model, year, etc). Then there is a subform to put in car parts. When you fill out the car part form, it automatically adds that car part to the list of car parts on the main form. You can then go back to the main form later, and check off the parts of the car you have, and when you hit save on the main form, it automatically saves the obtained status for each car part. Basically a Main form with a dynamically generated list of items as part of the form. It is MUCH easier to save these records to the database if everything is represented as DynaForms. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:27 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav a:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:821) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 254) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) -Original Message- From: Takhar, Sandeep [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 7:44 AM To: Struts Users Mailing List Subject: RE: Creating an indexed property of DynaActionForms Use the lazyValidatorActionForm, which
Re: Creating an indexed property of DynaActionForms
OK, then I repeat my earlier answer - use (or at least look at) the Lazy versions I wrote. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ is all it needs. If you look at the get(String name, int index) method in LazyValidatorForm, then it generates an ArrayList of LazyDynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:51 PM Subject: RE: Creating an indexed property of DynaActionForms Let me rephrase :) its MUCH easier to save these records to the database if everything is represented as DynaBeans That would be what I meant to say :) I'm writing the Actions separately, they are not Dyna-anything. I defined all my beans as DynaBeans in the struts-config.xml file, and I wrote some code that allows me to make one call to save a dynabean straight to my database, which I call in my Action. Where I'm running into trouble is when I want to embed one dynabean inside another (like my example below, where I want to write to multiple database records off the same form). How could I make this work? Writing regular non-dynbeans would multiply maintenance incredibly. Nathan -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:08 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms DynaActionForm is an ActionForm that implements the DynaBean interface. I would understand if you said its MUCH easier to save these records to the database if everything is represented as DynaBeans, but not DynaForms - why would you need it to be an ActioForm as well as a DynaBean and not just a DynaBean. Its the implementation of the DynaBean interface in DynaActioForm that makes it Dyna, the ActionForm bit is just for struts. The lazy stuff I wrote caters for exactly the scenario you talk about, but with DynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 9:44 PM Subject: RE: Creating an indexed property of DynaActionForms Lemme give an example, Lets say I have a form for Cars. The main form allows them to put in the details of the Car (make, model, year, etc). Then there is a subform to put in car parts. When you fill out the car part form, it automatically adds that car part to the list of car parts on the main form. You can then go back to the main form later, and check off the parts of the car you have, and when you hit save on the main form, it automatically saves the obtained status for each car part. Basically a Main form with a dynamically generated list of items as part of the form. It is MUCH easier to save these records to the database if everything is represented as DynaForms. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:27 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.jav a:801) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:881) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess or.java:821) at
Re: Non-Form Based Mapped Properties
I created a simple class with the map and setValue(Object key, Object value) as well as getValue(Object key). Then tested the class by putting an instance of the class into session scope on a page, retrieving the object on the same page, and trying to access the properties via the mapped properties value(keyName). I made sure the object was obtained via the logic tag, but the mapped property does not work for me. Any ideas? If not, I will put the whole thing into this exchange. Thanks. Michael At 08:56 AM 4/21/2004, Bill Siggelkow wrote: Michael McGrady wrote: Is there a way to use non-form based mapped and indexed properties with bean and/or html tags? Apparently not? Yes -- you can used both mapped and indexed properties from normal JavaBeans. You can be more specific on the problem you are having? Bill Siggelkow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
what could cause this Class Cast exception
I know this is not truly struts related but... I had a servlet that loaded blobs from oracle (pdf files). This worked perfect. I copied the code into my action and I know receive this error: java.lang.ClassCastException at reporting.viewer.presentation.actions.ViewReport.execute(ViewReport.java :86) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) here is the code // Obtain our environment naming context Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up our data source DataSource ds = (DataSource) envCtx.lookup(jdbc/report-viewer); // Allocate and use a connection from the pool Connection conn = ds.getConnection(); PreparedStatement ps = null; ResultSet rs = null; . if (rs.next()) { OracleResultSet ors = (OracleResultSet)rs; (THIS IS LINE 86 of ViewReport.java) BLOB blob = ors.getBLOB(2); if (blob != null) { response.setContentType(rs.getString(1)); InputStream is = blob.getBinaryStream(); int size = blob.getBufferSize(); byte[] buffer = new byte[size]; int length = -1; while ((length = is.read(buffer)) != -1) { out.write(buffer, 0, length); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Non-Form Based Mapped Properties
Haven't done this but either your class needs to be a Map implementation or you need getter/setter for your Map public void setMyMap(Map myMap) public Map getMyMap() The problem with using the html tags and not having your Map as a property of the ActionForm is that when the form is submitted, Struts is going to try to populate these properties in the form. Niall - Original Message - From: Michael McGrady [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 11:50 PM Subject: Re: Non-Form Based Mapped Properties I created a simple class with the map and setValue(Object key, Object value) as well as getValue(Object key). Then tested the class by putting an instance of the class into session scope on a page, retrieving the object on the same page, and trying to access the properties via the mapped properties value(keyName). I made sure the object was obtained via the logic tag, but the mapped property does not work for me. Any ideas? If not, I will put the whole thing into this exchange. Thanks. Michael At 08:56 AM 4/21/2004, Bill Siggelkow wrote: Michael McGrady wrote: Is there a way to use non-form based mapped and indexed properties with bean and/or html tags? Apparently not? Yes -- you can used both mapped and indexed properties from normal JavaBeans. You can be more specific on the problem you are having? Bill Siggelkow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: flaky error: Error - tag.getAsString : component context is not defined
Niall, thanks for your response. It would appear that this is the result of the user having javascript disabled on their browser. Also, once we established that the users were not actually submitting their forms, but were getting the error as soon as they clicked on the link, it made it much easier to narrow down the problem. This was the link: a href=# onclick=showhide('contactForm'); return(false);strongAdd Contact Form/strong/a/td The onclick is being ignored, and the a href=#... Was getting called which was BAD. It's the same result as if I did a right-click on the link and selected 'open in new browser'. So.. Not a struts issue at all. Cheers, Janice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts and Hibernate
Mario, Where is your hibernate.properties file? in WEB-INF/classes or somewhere else? Regards, David -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:09 AM To: 'Struts Users Mailing List' Subject: RE: Struts and Hibernate could the problem lie beneath the different jdbc-drivers you two guys use? Joe, you are using the newest generation mysql-driver. Mario uses the old one. I also experienced strange stuff using the old one. worked after switching to the new one... hth Alexander -Original Message- From: Joe Hertz [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 8. April 2004 08:08 To: [EMAIL PROTECTED] Subject: Re: Struts and Hibernate Mario, hibernate config look like? If it's saying the dialect doesn't support identity (and MySQL clearly does -- I use it!), then I'm betting it's the dialect you've specified. What follows is a snippet from my hibernate.properties file. HTH -Joe hibernate.dialect = net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class = com.mysql.jdbc.Driver hibernate.connection.url = jdbc:mysql://localhost:3306/bb?autoReconnect=true -Original Message- From: Mario St-Gelais [mailto:[EMAIL PROTECTED] Sent: Thursday, April 08, 2004 1:08 AM To: Struts Users Mailing List Subject: Re: Struts and Hibernate David Friedman wrote: Nick, Your problem is the type set in your id.../ tag. From (RTFM) the page: http://www.hibernate.org/hib_docs/reference/html/or-mapping.h tml#or-mapping- s1-4--generator See the identity description, which reads: identity - supports identity columns in DB2, MySQL, MS SQL Server, Sybase and HypersonicSQL. The returned identifier is of type long, short or int. The issue is your attempted use of class java.lang.Long instead of of long, short, or int. I had a similar problem months ago when I started using Hibernate, until I re-read that primer. Also, you may wish to set your generator from identity to native. That way, if you switch database products, it will automatically figure out if it can use identity, sequence, or hilo. (see the same document section just a few lines lower under the native explanation) Regards, David Well Gentleman, it is a big FAIL!! Still not working. It is one o'clock in the morning, I am calling it a day. A bad way to finish it though. I hit on the hibernate forum as you suggested Nick, without not much succes. But I posted a message on a thread discussing the same issued I am having... -- _ Mario St-Gelais www.gestionti.com Good judgment comes from experience- usually experience which was the result of poor judgment Bill Putnam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: flaky error: Error - tag.getAsString : component context is not defined
Thats good you sorted it out, and that you posted the cause/solution back to the list. We could do with some Wiki pages where people could record errors and their cause/solution - kind of knowledge base, I'm sure it would help alot of people - it can be difficult to find these kinds of things from trawling the list archvies. Niall - Original Message - From: Janice [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:27 AM Subject: RE: flaky error: Error - tag.getAsString : component context is not defined Niall, thanks for your response. It would appear that this is the result of the user having javascript disabled on their browser. Also, once we established that the users were not actually submitting their forms, but were getting the error as soon as they clicked on the link, it made it much easier to narrow down the problem. This was the link: a href=# onclick=showhide('contactForm'); return(false);strongAdd Contact Form/strong/a/td The onclick is being ignored, and the a href=#... Was getting called which was BAD. It's the same result as if I did a right-click on the link and selected 'open in new browser'. So.. Not a struts issue at all. Cheers, Janice - 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]
ActionErrors in my JSP: how can I rewrite this RT snippet as EL?
Hi I'm displaying validate() ActionErrors in my JSP using the RT html:errors tag. But I can't seem to be able to successfully rewrite my snippet of Struts RT in EL. This works: %@ page import=org.apache.struts.Globals% %@ page import=org.apache.struts.action.ActionMessages% ... logic-rt:present name=%=Globals.ERROR_KEY% html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/ /logic-rt:present But this doesn't work (using the logic html EL taglibs): %@ page import=org.apache.struts.Globals% %@ page import=org.apache.struts.action.ActionMessages% ... logic:present name=org.apache.struts.Globals.ERROR_KEY html:errors property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/ /logic:present Can anyone help? Thanks -- bOOyah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionErrors in my JSP: how can I rewrite this RT snippet as EL?
It should be logic:present name=org.apache.struts.action.ERROR html:errors property=org.apache.struts.action.GLOBAL_MESSAGE/ /logic:present .. or even logic:messagesPresent html:errors property=org.apache.struts.action.GLOBAL_MESSAGE/ /logic:messagesPresent - Original Message - From: bOOyah [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:31 AM Subject: ActionErrors in my JSP: how can I rewrite this RT snippet as EL? Hi I'm displaying validate() ActionErrors in my JSP using the RT html:errors tag. But I can't seem to be able to successfully rewrite my snippet of Struts RT in EL. This works: %@ page import=org.apache.struts.Globals% %@ page import=org.apache.struts.action.ActionMessages% ... logic-rt:present name=%=Globals.ERROR_KEY% html-rt:errors property=%=ActionMessages.GLOBAL_MESSAGE%/ /logic-rt:present But this doesn't work (using the logic html EL taglibs): %@ page import=org.apache.struts.Globals% %@ page import=org.apache.struts.action.ActionMessages% ... logic:present name=org.apache.struts.Globals.ERROR_KEY html:errors property=org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE/ /logic:present Can anyone help? Thanks -- bOOyah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: what could cause this Class Cast exception
So what would be the best way of converting that wrapper class into an OracleResultSet? Is the problem that an OracleResultSet extends java.sql.ResultSet and the Wrapper implements it? Nathan On Apr 21, 2004, at 5:29 PM, Niall Pemberton wrote: So if its not an OracleResultSet, then what kind is it? I believe if you use something like Commons dbcp it uses wrappers for everything - DelegatingResultSet Niall - Original Message - From: Nathan Maves [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:15 AM Subject: what could cause this Class Cast exception I know this is not truly struts related but... I had a servlet that loaded blobs from oracle (pdf files). This worked perfect. I copied the code into my action and I know receive this error: java.lang.ClassCastException at reporting.viewer.presentation.actions.ViewReport.execute(ViewReport.ja va :86) at org.apache.struts.action.RequestProcessor.processActionPerform(Request Pr ocessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav a: 274) here is the code // Obtain our environment naming context Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up our data source DataSource ds = (DataSource) envCtx.lookup(jdbc/report-viewer); // Allocate and use a connection from the pool Connection conn = ds.getConnection(); PreparedStatement ps = null; ResultSet rs = null; . if (rs.next()) { OracleResultSet ors = (OracleResultSet)rs; (THIS IS LINE 86 of ViewReport.java) BLOB blob = ors.getBLOB(2); if (blob != null) { response.setContentType(rs.getString(1)); InputStream is = blob.getBinaryStream(); int size = blob.getBufferSize(); byte[] buffer = new byte[size]; int length = -1; while ((length = is.read(buffer)) != -1) { out.write(buffer, 0, length); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Creating an indexed property of DynaActionForms
Thanks I will. I might also extend DynaValidatorForm to make it work like LazyValidatorForm (so I don't have to rewrite code I've already made). -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wed 4/21/2004 6:10 PM To: Struts Users Mailing List Cc: Subject:Re: Creating an indexed property of DynaActionForms OK, then I repeat my earlier answer - use (or at least look at) the Lazy versions I wrote. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ is all it needs. If you look at the get(String name, int index) method in LazyValidatorForm, then it generates an ArrayList of LazyDynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:51 PM Subject: RE: Creating an indexed property of DynaActionForms Let me rephrase :) its MUCH easier to save these records to the database if everything is represented as DynaBeans That would be what I meant to say :) I'm writing the Actions separately, they are not Dyna-anything. I defined all my beans as DynaBeans in the struts-config.xml file, and I wrote some code that allows me to make one call to save a dynabean straight to my database, which I call in my Action. Where I'm running into trouble is when I want to embed one dynabean inside another (like my example below, where I want to write to multiple database records off the same form). How could I make this work? Writing regular non-dynbeans would multiply maintenance incredibly. Nathan -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:08 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms DynaActionForm is an ActionForm that implements the DynaBean interface. I would understand if you said its MUCH easier to save these records to the database if everything is represented as DynaBeans, but not DynaForms - why would you need it to be an ActioForm as well as a DynaBean and not just a DynaBean. Its the implementation of the DynaBean interface in DynaActioForm that makes it Dyna, the ActionForm bit is just for struts. The lazy stuff I wrote caters for exactly the scenario you talk about, but with DynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 9:44 PM Subject: RE: Creating an indexed property of DynaActionForms Lemme give an example, Lets say I have a form for Cars. The main form allows them to put in the details of the Car (make, model, year, etc). Then there is a subform to put in car parts. When you fill out the car part form, it automatically adds that car part to the list of car parts on the main form. You can then go back to the main form later, and check off the parts of the car you have, and when you hit save on the main form, it automatically saves the obtained status for each car part. Basically a Main form with a dynamically generated list of items as part of the form. It is MUCH easier to save these records to the database if everything is represented as DynaForms. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:27 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:474) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt ils.java:428) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUti ls.java:770) at
Re: what could cause this Class Cast exception
Well you need to get the original ResultSet out of the wrapper - I don't use dbcp, but looking at the source code it looks like getInnermostDelegate() does that. http://cvs.apache.org/viewcvs.cgi/jakarta-commons/dbcp/src/java/org/apache/commons/dbcp/ The thing is, do you need to cast it to an OracleResultSet at all, can't you use the standard ResultSet.getBlob(int) method? Niall - Original Message - From: Nathan Maves [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:54 AM Subject: Re: what could cause this Class Cast exception So what would be the best way of converting that wrapper class into an OracleResultSet? Is the problem that an OracleResultSet extends java.sql.ResultSet and the Wrapper implements it? Nathan On Apr 21, 2004, at 5:29 PM, Niall Pemberton wrote: So if its not an OracleResultSet, then what kind is it? I believe if you use something like Commons dbcp it uses wrappers for everything - DelegatingResultSet Niall - Original Message - From: Nathan Maves [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:15 AM Subject: what could cause this Class Cast exception I know this is not truly struts related but... I had a servlet that loaded blobs from oracle (pdf files). This worked perfect. I copied the code into my action and I know receive this error: java.lang.ClassCastException at reporting.viewer.presentation.actions.ViewReport.execute(ViewReport.ja va :86) at org.apache.struts.action.RequestProcessor.processActionPerform(Request Pr ocessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.jav a: 274) here is the code // Obtain our environment naming context Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up our data source DataSource ds = (DataSource) envCtx.lookup(jdbc/report-viewer); // Allocate and use a connection from the pool Connection conn = ds.getConnection(); PreparedStatement ps = null; ResultSet rs = null; . if (rs.next()) { OracleResultSet ors = (OracleResultSet)rs; (THIS IS LINE 86 of ViewReport.java) BLOB blob = ors.getBLOB(2); if (blob != null) { response.setContentType(rs.getString(1)); InputStream is = blob.getBinaryStream(); int size = blob.getBufferSize(); byte[] buffer = new byte[size]; int length = -1; while ((length = is.read(buffer)) != -1) { out.write(buffer, 0, length); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating an indexed property of DynaActionForms
If you implement it yourself in DynaValidatorForm there is a LazyList class in Commons collections which you might like to use. http://cvs.apache.org/viewcvs.cgi/jakarta-commons/collections/src/java/org/apache/commons/collections/list/ Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:57 AM Thanks I will. I might also extend DynaValidatorForm to make it work like LazyValidatorForm (so I don't have to rewrite code I've already made). -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wed 4/21/2004 6:10 PM OK, then I repeat my earlier answer - use (or at least look at) the Lazy versions I wrote. http://www.niallp.pwp.blueyonder.co.uk/ form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ is all it needs. If you look at the get(String name, int index) method in LazyValidatorForm, then it generates an ArrayList of LazyDynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:51 PM Subject: RE: Creating an indexed property of DynaActionForms Let me rephrase :) its MUCH easier to save these records to the database if everything is represented as DynaBeans That would be what I meant to say :) I'm writing the Actions separately, they are not Dyna-anything. I defined all my beans as DynaBeans in the struts-config.xml file, and I wrote some code that allows me to make one call to save a dynabean straight to my database, which I call in my Action. Where I'm running into trouble is when I want to embed one dynabean inside another (like my example below, where I want to write to multiple database records off the same form). How could I make this work? Writing regular non-dynbeans would multiply maintenance incredibly. Nathan -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:08 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms DynaActionForm is an ActionForm that implements the DynaBean interface. I would understand if you said its MUCH easier to save these records to the database if everything is represented as DynaBeans, but not DynaForms - why would you need it to be an ActioForm as well as a DynaBean and not just a DynaBean. Its the implementation of the DynaBean interface in DynaActioForm that makes it Dyna, the ActionForm bit is just for struts. The lazy stuff I wrote caters for exactly the scenario you talk about, but with DynaBeans. Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 9:44 PM Subject: RE: Creating an indexed property of DynaActionForms Lemme give an example, Lets say I have a form for Cars. The main form allows them to put in the details of the Car (make, model, year, etc). Then there is a subform to put in car parts. When you fill out the car part form, it automatically adds that car part to the list of car parts on the main form. You can then go back to the main form later, and check off the parts of the car you have, and when you hit save on the main form, it automatically saves the obtained status for each car part. Basically a Main form with a dynamically generated list of items as part of the form. It is MUCH easier to save these records to the database if everything is represented as DynaForms. -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 4:27 PM To: Struts Users Mailing List Subject: Re: Creating an indexed property of DynaActionForms I don't understand why you need ActionForms embedded in your main ActionForm - don't these sub forms just need to be some sort of DynaBeans rather than ActionForm? If you want to use the Lazy versions, then just make it your main ActionForm: form-bean name=SampleMain dynamic=true type=lib.framework.util.LazyValidatorForm/ Then in your jsp html:text property=subForm1[${status.index}].property1 size=5 / html:text property=subForm1[${status.index}].property2 size=5 / Should populate an ArrayList of LazyDynaBeans containing property1 and property2 Niall - Original Message - From: Nathan Ewing [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 8:53 PM Subject: RE: Creating an indexed property of DynaActionForms I tried replacing the form-property name=subForm1 type=SubForm[]/ with: form-property name=subForm1 type=com.mysite.LazyValidatorForm[]/ And I get the following when I hit the submit button on my form: Root Cause java.lang.ArrayIndexOutOfBoundsException at java.lang.reflect.Array.get(Native Method) at org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:296) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUt
RE: Getting the form bean on a page for use in a core tag
Bill, Thanks for your help here. We actually ended up working down a different path for this particular issue but I am now using this technique in other code. One thing we did to make the core tag code more generic was to store a reference to the form bean in the request attributes under a short, constant value ('formBean'). This way our el can look like ${formBean.map.txtFullLegalName}, much like the way the html tags pick up the form bean by default. We were able to do this (setting the form bean) consistently because we are running thru a little process type action which is subclassed for each process. Lukas -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Wednesday, 21 April 2004 1:53 p.m. To: [EMAIL PROTECTED] Subject: Re: Getting the form bean on a page for use in a core tag Ahh! Bach! The wrinkle here is the DynaValidatorForm and not a regular ActionForm ... Try this ... core:if test=${studentDetailsBasicForm.map.age 20} pdo something/p /core:if For complete details ... http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaAction Form.html#getMap() Bill Siggelkow Lukas wrote: Daniel, What i'm trying to achieve is to use the core:if tag to conditionally show some content based on a value of the form bean. Something along the lines.. core:if test=${studentDetailsBasicForm.age 20} pdo something/p /core:if where 'studentDetailsBasicForm' is the name of my form for the action of which this jsp page is a view (a forward) and age is a property of that form. In this case the form is a DynaValidatorActionForm. I'm not in the office at the moment so the code is just from memory, but it gives you the idea. I guess i could use the bean:define to copy out each attribute of the bean, but it doesn't seem very tidy. Lukas -Original Message- From: Daniel Henrique Alves Lima [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 April 2004 10:52 p.m. To: Struts Users Mailing List Subject: Re: Getting the form bean on a page for use in a core tag Lukas, i don't know if i understand your question, but: Can you use bean:define to access and rename your bean so you can use it in a el expression ? Lukas Hazlehurst wrote: Hello, I apologise if I've missed something obvious somewhere, but I'm trying to use a property of my form bean in a core tag, and I'm just missing how to refer to the form bean easily, since the constant name has full stops in it which I presume will muck up the el expression. I've been looking thru my list archives and I can't seem to find any reference to the problem which probably means I'm missing the point somewhere, but any help would be appreciated. Lukas - 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getting the form bean on a page for use in a core tag
Struts already does this, it stores the form under the name you specified in your action mapping. So if you have: action path=/myActionPath name=myFom ... Then struts stores the form under myForm in whatever scope you specify (request or session). Niall - Original Message - From: Lukas Hazlehurst [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 2:26 AM Subject: RE: Getting the form bean on a page for use in a core tag Bill, Thanks for your help here. We actually ended up working down a different path for this particular issue but I am now using this technique in other code. One thing we did to make the core tag code more generic was to store a reference to the form bean in the request attributes under a short, constant value ('formBean'). This way our el can look like ${formBean.map.txtFullLegalName}, much like the way the html tags pick up the form bean by default. We were able to do this (setting the form bean) consistently because we are running thru a little process type action which is subclassed for each process. Lukas -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Wednesday, 21 April 2004 1:53 p.m. To: [EMAIL PROTECTED] Subject: Re: Getting the form bean on a page for use in a core tag Ahh! Bach! The wrinkle here is the DynaValidatorForm and not a regular ActionForm ... Try this ... core:if test=${studentDetailsBasicForm.map.age 20} pdo something/p /core:if For complete details ... http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaAction Form.html#getMap() Bill Siggelkow Lukas wrote: Daniel, What i'm trying to achieve is to use the core:if tag to conditionally show some content based on a value of the form bean. Something along the lines.. core:if test=${studentDetailsBasicForm.age 20} pdo something/p /core:if where 'studentDetailsBasicForm' is the name of my form for the action of which this jsp page is a view (a forward) and age is a property of that form. In this case the form is a DynaValidatorActionForm. I'm not in the office at the moment so the code is just from memory, but it gives you the idea. I guess i could use the bean:define to copy out each attribute of the bean, but it doesn't seem very tidy. Lukas -Original Message- From: Daniel Henrique Alves Lima [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 April 2004 10:52 p.m. To: Struts Users Mailing List Subject: Re: Getting the form bean on a page for use in a core tag Lukas, i don't know if i understand your question, but: Can you use bean:define to access and rename your bean so you can use it in a el expression ? Lukas Hazlehurst wrote: Hello, I apologise if I've missed something obvious somewhere, but I'm trying to use a property of my form bean in a core tag, and I'm just missing how to refer to the form bean easily, since the constant name has full stops in it which I presume will muck up the el expression. I've been looking thru my list archives and I can't seem to find any reference to the problem which probably means I'm missing the point somewhere, but any help would be appreciated. Lukas - 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: exception in Tiles controller
I'm sure this was discussed recently, all I could find was the following: http://www.mail-archive.com/[EMAIL PROTECTED]/msg94001.html http://www.mail-archive.com/[EMAIL PROTECTED]/msg66672.html Niall - Original Message - From: Lowery, Mat [EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 9:49 PM I'd like for an exception in a Tiles controller to go to a dedicated error page. Right now it seems the tiles:insert tag is swallowing the exception. The tag just prints the exception out on a half-completed page. Any ideas? Thanks, Mat Lowery - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Non-Form Based Mapped Properties
I have getMap and setMap. Also, I want to use bean:write rather than html:text. What do you think? Michael At 04:22 PM 4/21/2004, Niall Pemberton wrote: Haven't done this but either your class needs to be a Map implementation or you need getter/setter for your Map public void setMyMap(Map myMap) public Map getMyMap() The problem with using the html tags and not having your Map as a property of the ActionForm is that when the form is submitted, Struts is going to try to populate these properties in the form. Niall - Original Message - From: Michael McGrady [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 11:50 PM Subject: Re: Non-Form Based Mapped Properties I created a simple class with the map and setValue(Object key, Object value) as well as getValue(Object key). Then tested the class by putting an instance of the class into session scope on a page, retrieving the object on the same page, and trying to access the properties via the mapped properties value(keyName). I made sure the object was obtained via the logic tag, but the mapped property does not work for me. Any ideas? If not, I will put the whole thing into this exchange. Thanks. Michael At 08:56 AM 4/21/2004, Bill Siggelkow wrote: Michael McGrady wrote: Is there a way to use non-form based mapped and indexed properties with bean and/or html tags? Apparently not? Yes -- you can used both mapped and indexed properties from normal JavaBeans. You can be more specific on the problem you are having? Bill Siggelkow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting the form bean on a page for use in a core tag
Niall, Sorry if I was unclear, I understand that the form is placed in the request as the form name, but what we were doing was putting it under a constant key, so regardless of what you actually called the form in your action element it would always be available in the request under a constant key. I believe struts already does this also, but it uses a rather long string, from memory 'org.apache.struts.taglib.html.BEAN', but I don't believe that this would play nicely with EL expressions and its too long to be convenient. Lukas -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Thursday, 22 April 2004 1:41 p.m. To: Struts Users Mailing List Subject: Re: Getting the form bean on a page for use in a core tag Struts already does this, it stores the form under the name you specified in your action mapping. So if you have: action path=/myActionPath name=myFom ... Then struts stores the form under myForm in whatever scope you specify (request or session). Niall - Original Message - From: Lukas Hazlehurst [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, April 22, 2004 2:26 AM Subject: RE: Getting the form bean on a page for use in a core tag Bill, Thanks for your help here. We actually ended up working down a different path for this particular issue but I am now using this technique in other code. One thing we did to make the core tag code more generic was to store a reference to the form bean in the request attributes under a short, constant value ('formBean'). This way our el can look like ${formBean.map.txtFullLegalName}, much like the way the html tags pick up the form bean by default. We were able to do this (setting the form bean) consistently because we are running thru a little process type action which is subclassed for each process. Lukas -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Wednesday, 21 April 2004 1:53 p.m. To: [EMAIL PROTECTED] Subject: Re: Getting the form bean on a page for use in a core tag Ahh! Bach! The wrinkle here is the DynaValidatorForm and not a regular ActionForm ... Try this ... core:if test=${studentDetailsBasicForm.map.age 20} pdo something/p /core:if For complete details ... http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaActi on Form.html#getMap() Bill Siggelkow Lukas wrote: Daniel, What i'm trying to achieve is to use the core:if tag to conditionally show some content based on a value of the form bean. Something along the lines.. core:if test=${studentDetailsBasicForm.age 20} pdo something/p /core:if where 'studentDetailsBasicForm' is the name of my form for the action of which this jsp page is a view (a forward) and age is a property of that form. In this case the form is a DynaValidatorActionForm. I'm not in the office at the moment so the code is just from memory, but it gives you the idea. I guess i could use the bean:define to copy out each attribute of the bean, but it doesn't seem very tidy. Lukas -Original Message- From: Daniel Henrique Alves Lima [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 April 2004 10:52 p.m. To: Struts Users Mailing List Subject: Re: Getting the form bean on a page for use in a core tag Lukas, i don't know if i understand your question, but: Can you use bean:define to access and rename your bean so you can use it in a el expression ? Lukas Hazlehurst wrote: Hello, I apologise if I've missed something obvious somewhere, but I'm trying to use a property of my form bean in a core tag, and I'm just missing how to refer to the form bean easily, since the constant name has full stops in it which I presume will muck up the el expression. I've been looking thru my list archives and I can't seem to find any reference to the problem which probably means I'm missing the point somewhere, but any help would be appreciated. Lukas --- -- 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] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.659 / Virus Database: 423 - Release Date: 15/04/2004
How to pre-populate values to nested:radio buttons from Database
Hi friends I'm always thankful to u 4ur non-stop help towards me. Here is a problem with nested:readiobuttons. Pls observer the sample code. nested:iterate property="mtList" id="mtlist" tr valign="middle" class="trcolor2" tdnested:radio property="shiftnumber" value='0'/nested:radio/td tdnested:radio property="shiftnumber" value='1'/nested:radio/td tdnested:radio property="shiftnumber" value='2'/nested:radio/td tdnested:radio property="shiftnumber" value='3'/nested:radio/td /tr /nested:iterate Now what my intension is to pre-populate values from database to 'radio' buttons whatever value was selected among 4radio buttons which r in a single row as a group. i keep waiting 4u reply . Thanks Regards Ganesh Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢---BeginMessage--- Hi friends I'm always thankful to u 4ur non-stop help towards me. Here is a problem with nested:readiobuttons. Pls observer the sample code. nested:iterate property=mtList id=mtlist tr valign=middle class=trcolor2 tdnested:radio property=shiftnumber value='0'/nested:radio/td tdnested:radio property=shiftnumber value='1'/nested:radio/td tdnested:radio property=shiftnumber value='2'/nested:radio/td tdnested:radio property=shiftnumber value='3'/nested:radio/td /tr /nested:iterate Now what my intension is to pre-populate values from database to 'radio' buttons whatever value was selected among 4radio buttons which r in a single row as a group. i keep waiting 4u reply . Thanks Regards Ganesh - Do you Yahoo!? Yahoo! Photos: High-quality 4x6 digital prints for 25¢---End Message--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts and Hibernate
Mario, I'm glad to hear it is working. I couldn't get my properties file to work with spaces, I had to use equals signs: hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect hibernate.connection.username=X hibernate.connection.password=Y hibernate.connection.url=jdbc:mysql://localhost:3306/test hibernate.connection.driver_class=com.mysql.jdbc.Driver As for your Eclipse problem, if you are using Eclipse v2.1.X (I'm on 2.1.3), try this: go to the Java perspective, right clicking on the project name, choose properties, select Java Build Path, and edit the Source folders on build path entry so $TOMCAT/webapps/example1/WEB-INF/src becomes $TOMCAT/webapps/example1/WEB-INF/src/java and make sure the Default Output Folder lists $TOMCAT/webapps/example1/WEB-INF/classes. That should class compilation so java files under WEB-INF/src/java compile WEB-INF/classes instead of showing up under WEB-INF/classes/java. I.E. WEB-INF/src/java/com/edhand/whatever.java shows up now (as you described below) compiled as WEB-INF/classes/java/com/edhand/whatever.java when this change would make it compile properly as WEB-INF/classes/com/edhand/whatever.java Regards, David -Original Message- From: Mario St-Gelais [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:14 PM To: Struts Users Mailing List Subject: Re: Struts and Hibernate David Friedman wrote: Mario, Where is your hibernate.properties file? in WEB-INF/classes or somewhere else? Regards, David -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:09 AM To: 'Struts Users Mailing List' Subject: RE: Struts and Hibernate could the problem lie beneath the different jdbc-drivers you two guys use? Joe, you are using the newest generation mysql-driver. Mario uses the old one. I also experienced strange stuff using the old one. worked after switching to the new one... hth Alexander It is actually working. Started all over from scratch. Can't figure how exactly what went wrong except for one or two things. Like the example shows for the property file : hibernate.dialect net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class org.gjt.mm.mysql.Driver hibernate.connection.driver_class com.mysql.jdbc.Driver hibernate.connection.url jdbc:mysql:///test hibernate.connection.username testuser See something wrong at line 4! Of course I did not see this at first!!! Should be hibernate.connection.url jdbc:mysql://localhost/test As far as it goes for the jdbc driver, I use mysql-connector-java-3.0.9 and no problem there. So that is something to know I guess. The Hibernate.properties file is in WEB-INF/classes. Also I am not familiar with Ant. But when using Eclipse like I do, I guess it is the best way to compile all classes with Eclipse i.e. it compiles automatically. But then this here : 12. Create directory |/com/edhand/example1| underneath |$TOMCAT/webapps/example1/WEB-INF/src/java|. Causes a problem. Because all packages are com.edhand, and Eclipse compile in java.com.edhand... Since then I also another example known as span. No success so far. And I haven't look at it for some days now... Mario - 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]
Advantages/Disadvantages of One Action for each Use Case
Hi, I was wondering what's the advantage and disadvantage of creating one Action for each use case, i.e. creating NewAccountAction.java EditAccountAction.java or even with NewAccountFormAction.java vs AccountAction.java and inside the AccountAction we can check parameter from the JSP then execute proper method (i.e createNewAccount, editAccount, etc) ? Perhaps the first option is similar to GoF's command pattern. Thanks a lot in advance. Dion -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:42 PM To: Struts Users Mailing List Subject: RE: Struts and Hibernate Mario, I'm glad to hear it is working. I couldn't get my properties file to work with spaces, I had to use equals signs: hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect hibernate.connection.username=X hibernate.connection.password=Y hibernate.connection.url=jdbc:mysql://localhost:3306/test hibernate.connection.driver_class=com.mysql.jdbc.Driver As for your Eclipse problem, if you are using Eclipse v2.1.X (I'm on 2.1.3), try this: go to the Java perspective, right clicking on the project name, choose properties, select Java Build Path, and edit the Source folders on build path entry so $TOMCAT/webapps/example1/WEB-INF/src becomes $TOMCAT/webapps/example1/WEB-INF/src/java and make sure the Default Output Folder lists $TOMCAT/webapps/example1/WEB-INF/classes. That should class compilation so java files under WEB-INF/src/java compile WEB-INF/classes instead of showing up under WEB-INF/classes/java. I.E. WEB-INF/src/java/com/edhand/whatever.java shows up now (as you described below) compiled as WEB-INF/classes/java/com/edhand/whatever.java when this change would make it compile properly as WEB-INF/classes/com/edhand/whatever.java Regards, David -Original Message- From: Mario St-Gelais [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:14 PM To: Struts Users Mailing List Subject: Re: Struts and Hibernate David Friedman wrote: Mario, Where is your hibernate.properties file? in WEB-INF/classes or somewhere else? Regards, David -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:09 AM To: 'Struts Users Mailing List' Subject: RE: Struts and Hibernate could the problem lie beneath the different jdbc-drivers you two guys use? Joe, you are using the newest generation mysql-driver. Mario uses the old one. I also experienced strange stuff using the old one. worked after switching to the new one... hth Alexander It is actually working. Started all over from scratch. Can't figure how exactly what went wrong except for one or two things. Like the example shows for the property file : hibernate.dialect net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class org.gjt.mm.mysql.Driver hibernate.connection.driver_class com.mysql.jdbc.Driver hibernate.connection.url jdbc:mysql:///test hibernate.connection.username testuser See something wrong at line 4! Of course I did not see this at first!!! Should be hibernate.connection.url jdbc:mysql://localhost/test As far as it goes for the jdbc driver, I use mysql-connector-java-3.0.9 and no problem there. So that is something to know I guess. The Hibernate.properties file is in WEB-INF/classes. Also I am not familiar with Ant. But when using Eclipse like I do, I guess it is the best way to compile all classes with Eclipse i.e. it compiles automatically. But then this here : 12. Create directory |/com/edhand/example1| underneath |$TOMCAT/webapps/example1/WEB-INF/src/java|. Causes a problem. Because all packages are com.edhand, and Eclipse compile in java.com.edhand... Since then I also another example known as span. No success so far. And I haven't look at it for some days now... Mario - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Advantages/Disadvantages of One Action for each Use Case
DispatchAction is what exactly is meant for these kinds of situations. Kulkarni. -Original Message- From: Dionisius Purba [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 10:43 AM To: 'Struts Users Mailing List' Subject: Advantages/Disadvantages of One Action for each Use Case Hi, I was wondering what's the advantage and disadvantage of creating one Action for each use case, i.e. creating NewAccountAction.java EditAccountAction.java or even with NewAccountFormAction.java vs AccountAction.java and inside the AccountAction we can check parameter from the JSP then execute proper method (i.e createNewAccount, editAccount, etc) ? Perhaps the first option is similar to GoF's command pattern. Thanks a lot in advance. Dion -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:42 PM To: Struts Users Mailing List Subject: RE: Struts and Hibernate Mario, I'm glad to hear it is working. I couldn't get my properties file to work with spaces, I had to use equals signs: hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect hibernate.connection.username=X hibernate.connection.password=Y hibernate.connection.url=jdbc:mysql://localhost:3306/test hibernate.connection.driver_class=com.mysql.jdbc.Driver As for your Eclipse problem, if you are using Eclipse v2.1.X (I'm on 2.1.3), try this: go to the Java perspective, right clicking on the project name, choose properties, select Java Build Path, and edit the Source folders on build path entry so $TOMCAT/webapps/example1/WEB-INF/src becomes $TOMCAT/webapps/example1/WEB-INF/src/java and make sure the Default Output Folder lists $TOMCAT/webapps/example1/WEB-INF/classes. That should class compilation so java files under WEB-INF/src/java compile WEB-INF/classes instead of showing up under WEB-INF/classes/java. I.E. WEB-INF/src/java/com/edhand/whatever.java shows up now (as you described below) compiled as WEB-INF/classes/java/com/edhand/whatever.java when this change would make it compile properly as WEB-INF/classes/com/edhand/whatever.java Regards, David -Original Message- From: Mario St-Gelais [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:14 PM To: Struts Users Mailing List Subject: Re: Struts and Hibernate David Friedman wrote: Mario, Where is your hibernate.properties file? in WEB-INF/classes or somewhere else? Regards, David -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:09 AM To: 'Struts Users Mailing List' Subject: RE: Struts and Hibernate could the problem lie beneath the different jdbc-drivers you two guys use? Joe, you are using the newest generation mysql-driver. Mario uses the old one. I also experienced strange stuff using the old one. worked after switching to the new one... hth Alexander It is actually working. Started all over from scratch. Can't figure how exactly what went wrong except for one or two things. Like the example shows for the property file : hibernate.dialect net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class org.gjt.mm.mysql.Driver hibernate.connection.driver_class com.mysql.jdbc.Driver hibernate.connection.url jdbc:mysql:///test hibernate.connection.username testuser See something wrong at line 4! Of course I did not see this at first!!! Should be hibernate.connection.url jdbc:mysql://localhost/test As far as it goes for the jdbc driver, I use mysql-connector-java-3.0.9 and no problem there. So that is something to know I guess. The Hibernate.properties file is in WEB-INF/classes. Also I am not familiar with Ant. But when using Eclipse like I do, I guess it is the best way to compile all classes with Eclipse i.e. it compiles automatically. But then this here : 12. Create directory |/com/edhand/example1| underneath |$TOMCAT/webapps/example1/WEB-INF/src/java|. Causes a problem. Because all packages are com.edhand, and Eclipse compile in java.com.edhand... Since then I also another example known as span. No success so far. And I haven't look at it for some days now... Mario - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Advantages/Disadvantages of One Action for each Use Case
I see. So there are three (3) alternatives that I know then. Anybody can point the pro/cons of each one? ~Dion~ -Original Message- From: Ravi Kulkarni [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:15 PM To: Struts Users Mailing List Subject: RE: Advantages/Disadvantages of One Action for each Use Case DispatchAction is what exactly is meant for these kinds of situations. Kulkarni. -Original Message- From: Dionisius Purba [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 10:43 AM To: 'Struts Users Mailing List' Subject: Advantages/Disadvantages of One Action for each Use Case Hi, I was wondering what's the advantage and disadvantage of creating one Action for each use case, i.e. creating NewAccountAction.java EditAccountAction.java or even with NewAccountFormAction.java vs AccountAction.java and inside the AccountAction we can check parameter from the JSP then execute proper method (i.e createNewAccount, editAccount, etc) ? Perhaps the first option is similar to GoF's command pattern. Thanks a lot in advance. Dion -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 12:42 PM To: Struts Users Mailing List Subject: RE: Struts and Hibernate Mario, I'm glad to hear it is working. I couldn't get my properties file to work with spaces, I had to use equals signs: hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect hibernate.connection.username=X hibernate.connection.password=Y hibernate.connection.url=jdbc:mysql://localhost:3306/test hibernate.connection.driver_class=com.mysql.jdbc.Driver As for your Eclipse problem, if you are using Eclipse v2.1.X (I'm on 2.1.3), try this: go to the Java perspective, right clicking on the project name, choose properties, select Java Build Path, and edit the Source folders on build path entry so $TOMCAT/webapps/example1/WEB-INF/src becomes $TOMCAT/webapps/example1/WEB-INF/src/java and make sure the Default Output Folder lists $TOMCAT/webapps/example1/WEB-INF/classes. That should class compilation so java files under WEB-INF/src/java compile WEB-INF/classes instead of showing up under WEB-INF/classes/java. I.E. WEB-INF/src/java/com/edhand/whatever.java shows up now (as you described below) compiled as WEB-INF/classes/java/com/edhand/whatever.java when this change would make it compile properly as WEB-INF/classes/com/edhand/whatever.java Regards, David -Original Message- From: Mario St-Gelais [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:14 PM To: Struts Users Mailing List Subject: Re: Struts and Hibernate David Friedman wrote: Mario, Where is your hibernate.properties file? in WEB-INF/classes or somewhere else? Regards, David -Original Message- From: Jesse Alexander (KXT) [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 5:09 AM To: 'Struts Users Mailing List' Subject: RE: Struts and Hibernate could the problem lie beneath the different jdbc-drivers you two guys use? Joe, you are using the newest generation mysql-driver. Mario uses the old one. I also experienced strange stuff using the old one. worked after switching to the new one... hth Alexander It is actually working. Started all over from scratch. Can't figure how exactly what went wrong except for one or two things. Like the example shows for the property file : hibernate.dialect net.sf.hibernate.dialect.MySQLDialect hibernate.connection.driver_class org.gjt.mm.mysql.Driver hibernate.connection.driver_class com.mysql.jdbc.Driver hibernate.connection.url jdbc:mysql:///test hibernate.connection.username testuser See something wrong at line 4! Of course I did not see this at first!!! Should be hibernate.connection.url jdbc:mysql://localhost/test As far as it goes for the jdbc driver, I use mysql-connector-java-3.0.9 and no problem there. So that is something to know I guess. The Hibernate.properties file is in WEB-INF/classes. Also I am not familiar with Ant. But when using Eclipse like I do, I guess it is the best way to compile all classes with Eclipse i.e. it compiles automatically. But then this here : 12. Create directory |/com/edhand/example1| underneath |$TOMCAT/webapps/example1/WEB-INF/src/java|. Causes a problem. Because all packages are com.edhand, and Eclipse compile in java.com.edhand... Since then I also another example known as span. No success so far. And I haven't look at it for some days now... Mario - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: basic problem in java
Below was the messages i was getting : I havent yet exactly found the reason why this happened im also sending the output of set command on dos prompt. C:\biren\javajavac jaba1.java jaba1.java:2: cannot resolve symbol symbol : class io location: class java import java.io.*; For following source code import java.io.*; public class jaba1 { public static void main(String[] args) { System.out.println(Hello World!); } } out put of my set command in dos prompt :- (I have already told that i deleted some of the folders in my C:\Documents and Settings\) ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\133044\Application Data CATALINA_HOME=c:\Tomcat CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat\common\lib\servlet.jar; CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=TCS021601 ComSpec=C:\WINNT\system32\cmd.exe HOMEDRIVE=Y: HOMEPATH=\ HOMESHARE=\\172.17.24.142\home1\133044 INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\ JAVA_HOME=C:\jsdk1.4.2 LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\ LOGONSERVER=\\ML06ADC01030304 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Os2LibPath=C:\WINNT\system32\os2\dll; Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jsdk1.4.2\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System3 2\Wbem; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=000a ProgramFiles=C:\Program Files PROMPT=$P$G SystemDrive=C: SystemRoot=C:\WINNT TEMP=C:\DOCUME~1\133044\LOCALS~1\Temp TMP=C:\WINNT\TEMP TOMCAT_HOME=. USERDNSDOMAIN=India.TCS.com USERDOMAIN=INDIA USERNAME=133044 USERPROFILE=C:\Documents and Settings\133044 windir=C:\WINNT Birendar Singh Waldiya Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED] 22-04-04 02:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: basic problem in java that probably won't compile either import java.io.*; class test { public static void main(String[] args) { System.out .println(My Apologies To all); } } you were missing ; after the import ant String [] as a paramter to main was declared wrong. Pritpal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 10:17 PM To: Struts Users Mailing List Subject: RE: basic problem in java Hi, Im very sorry and apologize to all for not telling the about the resolving problem, Actually my problem is resolved but i dont have the concrete solution for that , thats why i didnt wrote it. The probelm occured suddenly one day i was deleting folders from my macheine to free my disk space and in this process i deleted some of the folders of c:\ documents and settings (windows 2000 professional) however the things were working very fine before that suddenly this problem started occuring i could not get what happened because i was running and compiling everthing right before this and later it stoped working , then i copied some of the folder in my c:\documents and settings form some other persons machine and it started working .. so i did not understand what exactly was the cure of my problem : Note i did not deleted folder named with my login. i was compiling very simple program import java.io.* public class test{ public static void main(arg [] String ){ System.out .println(My Apologies To all); } } Birendar Singh Waldiya Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com David Friedman [EMAIL PROTECTED] 21-04-04 08:30 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java Dhaliwal, Birendar never seemed to post anthing after our answers and I was curious if the problem was solved. I was trying to be helpful and follow-up, not ask you for a rehash of the previously stated answers. Also, you shouldn't underestimate the classpath 8.3 issue on Windows XP. Thanks anyway, David -Original Message- From: Dhaliwal, Pritpal (HQP) [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 8:00 PM To: 'Struts Users Mailing List' Subject: RE: basic problem in java You are using something like SomeClass someClass = java.io.SomeClass(); See whats wrong with that? You are missing the new.. If its not that.. Well.. When you forget the new compiler puts out that kind of errors. Btw.. You classpath will be happy with .;c:\Drivers\classes111.zip; Provided that c:\Drivers and c:\biren\java do not have any classes in them. HTH, Pritpal Dhaliwal -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 2:09 PM To: Struts Users Mailing List Subject: RE: basic
RE: basic problem in java
I sent the possible reason , i didnt get exact one .. probaly you might have skipped my mail or deleted Birendar Singh Waldiya Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com David Friedman [EMAIL PROTECTED] 21-04-04 02:39 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java So Birendar, What was your problem? I never saw a post about you resolving it. (and, curiosity killed the cat) Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Sunday, April 18, 2004 3:16 AM To: Struts Users Mailing List Subject: RE: basic problem in java My Classpath variable is set to : C:\jdk1.3.1\bin;c:\jdk1.3.1\lib\tools.jar;c:\jdk1.3.1\lib\rt.jar;c:\Drivers\ classes111.zip;c:\Drivers\classes12.zip;c:\Drivers;c:\biren\java JDK is installed C:\jdk1.3.1 can you please help me ?? Birendar Singh Waldiya David Friedman [EMAIL PROTECTED] 17-04-04 08:54 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java What is your CLASSPATH variable set to and is java installed in c:\biren\java? Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, April 17, 2004 2:47 AM To: Struts Users Mailing List Subject: basic problem in java Hi, this may be a slightly silly question for people working on struts etc but im facing it and i dont have the clue why im getting it.. can anyone suggest me why im getting proble.. while compiling a java program my javac is unable to resolve the standard java classes like java.io.* java.util.* ; C:\biren\javajavac jaba1.java jaba1.java:2: cannot resolve symbol symbol : class io location: class java import java.io.*; whats the problem please help ! ^ Birendar Singh Waldiya ForwardSourceID:NT434E ForwardSourceID:NT4B02 DISCLAIMER: The information contained in this message is intended only and solely for the addressed individual or entity indicated in this message and for the exclusive use of the said addressed individual or entity indicated in this message (or responsible for delivery of the message to such person) and may contain legally privileged and confidential information belonging to Tata Consultancy Services. It must not be printed, read, copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person other than the addressee. Unauthorized use, disclosure or copying is strictly prohibited and may constitute unlawful act and can possibly attract legal action, civil and/or criminal. The contents of this message need not necessarily reflect or endorse the views of Tata Consultancy Services on any subject matter. Any action taken or omitted to be taken based on this message is entirely at your risk and neither the originator of this message nor Tata Consultancy Services takes any responsibility or liability towards the same. Opinions, conclusions and any other information contained in this message that do not relate to the official business of Tata Consultancy Services shall be understood as neither given nor endorsed by Tata Consultancy Services or any affiliate of Tata Consultancy Services. If you have received this message in error, you should destroy this message and may please notify the sender by e-mail. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: basic problem in java
Birendar, That is a nasty looking classpath with slashes going in both directions in your JDK path portion (incredibly unwise), long path names, and so forth. Did you try using dir /x to get the short (8.3) directory names and fixing your classpath from this CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; to something a bit more normal? Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:29 AM To: Struts Users Mailing List Subject: RE: basic problem in java Below was the messages i was getting : I havent yet exactly found the reason why this happened im also sending the output of set command on dos prompt. C:\biren\javajavac jaba1.java jaba1.java:2: cannot resolve symbol symbol : class io location: class java import java.io.*; For following source code import java.io.*; public class jaba1 { public static void main(String[] args) { System.out.println(Hello World!); } } out put of my set command in dos prompt :- (I have already told that i deleted some of the folders in my C:\Documents and Settings\) ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\133044\Application Data CATALINA_HOME=c:\Tomcat CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=TCS021601 ComSpec=C:\WINNT\system32\cmd.exe HOMEDRIVE=Y: HOMEPATH=\ HOMESHARE=\\172.17.24.142\home1\133044 INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\ JAVA_HOME=C:\jsdk1.4.2 LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\ LOGONSERVER=\\ML06ADC01030304 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Os2LibPath=C:\WINNT\system32\os2\dll; Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jsdk1.4.2\bin;C:\W INNT\system32;C:\WINNT;C:\WINNT\System3 2\Wbem; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=000a ProgramFiles=C:\Program Files PROMPT=$P$G SystemDrive=C: SystemRoot=C:\WINNT TEMP=C:\DOCUME~1\133044\LOCALS~1\Temp TMP=C:\WINNT\TEMP TOMCAT_HOME=. USERDNSDOMAIN=India.TCS.com USERDOMAIN=INDIA USERNAME=133044 USERPROFILE=C:\Documents and Settings\133044 windir=C:\WINNT Birendar Singh Waldiya Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED] 22-04-04 02:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: basic problem in java that probably won't compile either import java.io.*; class test { public static void main(String[] args) { System.out .println(My Apologies To all); } } you were missing ; after the import ant String [] as a paramter to main was declared wrong. Pritpal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 10:17 PM To: Struts Users Mailing List Subject: RE: basic problem in java Hi, Im very sorry and apologize to all for not telling the about the resolving problem, Actually my problem is resolved but i dont have the concrete solution for that , thats why i didnt wrote it. The probelm occured suddenly one day i was deleting folders from my macheine to free my disk space and in this process i deleted some of the folders of c:\ documents and settings (windows 2000 professional) however the things were working very fine before that suddenly this problem started occuring i could not get what happened because i was running and compiling everthing right before this and later it stoped working , then i copied some of the folder in my c:\documents and settings form some other persons machine and it started working .. so i did not understand what exactly was the cure of my problem : Note i did not deleted folder named with my login. i was compiling very simple program import java.io.* public class test{ public static void main(arg [] String ){ System.out .println(My Apologies To all); } } Birendar Singh Waldiya Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com David Friedman [EMAIL PROTECTED] 21-04-04 08:30 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java Dhaliwal, Birendar never seemed to post anthing after our answers and I was curious if the problem was solved. I was trying to be helpful and follow-up, not ask you
RE: basic problem in java
Yes it may me nasty but David im sorry i dont know dir / x and what is 8.3 directory names ?? I will correct the classpath surely. Birendar Singh Waldiya David Friedman [EMAIL PROTECTED] 22-04-04 11:19 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java Birendar, That is a nasty looking classpath with slashes going in both directions in your JDK path portion (incredibly unwise), long path names, and so forth. Did you try using dir /x to get the short (8.3) directory names and fixing your classpath from this CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; to something a bit more normal? Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:29 AM To: Struts Users Mailing List Subject: RE: basic problem in java Below was the messages i was getting : I havent yet exactly found the reason why this happened im also sending the output of set command on dos prompt. C:\biren\javajavac jaba1.java jaba1.java:2: cannot resolve symbol symbol : class io location: class java import java.io.*; For following source code import java.io.*; public class jaba1 { public static void main(String[] args) { System.out.println(Hello World!); } } out put of my set command in dos prompt :- (I have already told that i deleted some of the folders in my C:\Documents and Settings\) ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\133044\Application Data CATALINA_HOME=c:\Tomcat CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=TCS021601 ComSpec=C:\WINNT\system32\cmd.exe HOMEDRIVE=Y: HOMEPATH=\ HOMESHARE=\\172.17.24.142\home1\133044 INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\ JAVA_HOME=C:\jsdk1.4.2 LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\ LOGONSERVER=\\ML06ADC01030304 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Os2LibPath=C:\WINNT\system32\os2\dll; Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jsdk1.4.2\bin;C:\W INNT\system32;C:\WINNT;C:\WINNT\System3 2\Wbem; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=000a ProgramFiles=C:\Program Files PROMPT=$P$G SystemDrive=C: SystemRoot=C:\WINNT TEMP=C:\DOCUME~1\133044\LOCALS~1\Temp TMP=C:\WINNT\TEMP TOMCAT_HOME=. USERDNSDOMAIN=India.TCS.com USERDOMAIN=INDIA USERNAME=133044 USERPROFILE=C:\Documents and Settings\133044 windir=C:\WINNT Birendar Singh Waldiya Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED] 22-04-04 02:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: basic problem in java that probably won't compile either import java.io.*; class test { public static void main(String[] args) { System.out .println(My Apologies To all); } } you were missing ; after the import ant String [] as a paramter to main was declared wrong. Pritpal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 10:17 PM To: Struts Users Mailing List Subject: RE: basic problem in java Hi, Im very sorry and apologize to all for not telling the about the resolving problem, Actually my problem is resolved but i dont have the concrete solution for that , thats why i didnt wrote it. The probelm occured suddenly one day i was deleting folders from my macheine to free my disk space and in this process i deleted some of the folders of c:\ documents and settings (windows 2000 professional) however the things were working very fine before that suddenly this problem started occuring i could not get what happened because i was running and compiling everthing right before this and later it stoped working , then i copied some of the folder in my c:\documents and settings form some other persons machine and it started working .. so i did not understand what exactly was the cure of my problem : Note i did not deleted folder named with my login. i was compiling very simple program import java.io.* public class test{ public static void main(arg [] String ){ System.out .println(My Apologies To all); } } Birendar Singh Waldiya Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com David Friedman [EMAIL PROTECTED] 21-04-04 08:30 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic
RE: basic problem in java
I had trouble in a windows platform (Windows XP home) using directory names that don't follow the old 8 letter (or less) prefix and 3 letter extention in my ms-dos/command.com CLASSPATH variable. Using dir /x will show the old dos-style directory or file name. I found that using those names worked in my classpath so I could run Tomcat (or plain old Java programs) from the command line. So, instead of using c:\jdk1.4.2, the dir/x might show it as C:\JDK14~1.1 which works for me in the classpath while C:\jdk1.4.2 won't work so it won't find stock libraries like java.io.* or anything else you'd expect. Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:55 AM To: Struts Users Mailing List Subject: RE: basic problem in java Yes it may me nasty but David im sorry i dont know dir / xand what is 8.3 directory names ?? I will correct the classpath surely. Birendar Singh Waldiya David Friedman [EMAIL PROTECTED] 22-04-04 11:19 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To Struts Users Mailing List [EMAIL PROTECTED] cc Subject RE: basic problem in java Birendar, That is a nasty looking classpath with slashes going in both directions in your JDK path portion (incredibly unwise), long path names, and so forth. Did you try using dir /x to get the short (8.3) directory names and fixing your classpath from this CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; to something a bit more normal? Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 1:29 AM To: Struts Users Mailing List Subject: RE: basic problem in java Below was the messages i was getting : I havent yet exactly found the reason why this happened im also sending the output of set command on dos prompt. C:\biren\javajavac jaba1.java jaba1.java:2: cannot resolve symbol symbol : class io location: class java import java.io.*; For following source code import java.io.*; public class jaba1 { public static void main(String[] args) { System.out.println(Hello World!); } } out put of my set command in dos prompt :- (I have already told that i deleted some of the folders in my C:\Documents and Settings\) ALLUSERSPROFILE=C:\Documents and Settings\All Users APPDATA=C:\Documents and Settings\133044\Application Data CATALINA_HOME=c:\Tomcat CLASSPATH=.;C:\jsdk1.4.2/lib/tools.jar;.\classes;.\lib;%CLASSPATH%;c:\Tomcat \common\lib\servlet.jar; CommonProgramFiles=C:\Program Files\Common Files COMPUTERNAME=TCS021601 ComSpec=C:\WINNT\system32\cmd.exe HOMEDRIVE=Y: HOMEPATH=\ HOMESHARE=\\172.17.24.142\home1\133044 INCLUDE=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include\ JAVA_HOME=C:\jsdk1.4.2 LIB=C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Lib\ LOGONSERVER=\\ML06ADC01030304 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Os2LibPath=C:\WINNT\system32\os2\dll; Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jsdk1.4.2\bin;C:\W INNT\system32;C:\WINNT;C:\WINNT\System3 2\Wbem; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 0 Stepping 10, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=000a ProgramFiles=C:\Program Files PROMPT=$P$G SystemDrive=C: SystemRoot=C:\WINNT TEMP=C:\DOCUME~1\133044\LOCALS~1\Temp TMP=C:\WINNT\TEMP TOMCAT_HOME=. USERDNSDOMAIN=India.TCS.com USERDOMAIN=INDIA USERNAME=133044 USERPROFILE=C:\Documents and Settings\133044 windir=C:\WINNT Birendar Singh Waldiya Dhaliwal, Pritpal (HQP) [EMAIL PROTECTED] 22-04-04 02:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To 'Struts Users Mailing List' [EMAIL PROTECTED] cc Subject RE: basic problem in java that probably won't compile either import java.io.*; class test { public static void main(String[] args) { System.out .println(My Apologies To all); } } you were missing ; after the import ant String [] as a paramter to main was declared wrong. Pritpal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 20, 2004 10:17 PM To: Struts Users Mailing List Subject: RE: basic problem in java Hi, Im very sorry and apologize to all for not telling the about the resolving problem, Actually my problem is resolved but i dont have the concrete solution for that , thats why i didnt wrote it.