Re: validate= true destroys form defaults
I found out that that with validate=true the mydispatchaction *never* is called. The requestprocessor instanciates the actionform calls the reset() and validate() methods of the actionform. The validate() methods gives an error because nothing has been filled in. It does not call the dispatchaction so no chance to call the actionform setter methods. Of course everything works (without validation) as soon as I switch off validation. At the moment this validation feature looks - hmm - at least *strange* to me... Best regards, Carsten Hammer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validate= true destroys form defaults
I'm also guessing here.but I notice that reset() is called a lot.Do you have setters as well as getters for all of the form fields? I believe that the setters are used to 'hold on' to the field values during the reset. -Original Message- From: Dan Tran [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 3:21 PM To: Struts Users Mailing List Subject: Re: validate= true destroys form defaults This is my be a long shot, but I encountered it before. Makesure to make all your actions to have the same scope In this case: request. Do not leave it blank. ]-D - Original Message - From: Carsten Hammer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 12:01 PM Subject: validate= true destroys form defaults Hi, I use a dispatchaction to set actionform parameters using the actionform setter methods (I do not write it to the session!). The flow is this way: 1. Url: http://localhost:8080/mydispatchaction.do?method=view ;here the information is pulled from the database and put to the actionformbean using its setter methods. 2. This mydispatchaction.do forwards to the jsp. There the information from the database is presented and can be changed and submitted again to the mydispatchaction.do?method=save This all works as expected. Unfortunatly as soon as I switch on the validate switch in the struts config (1.1x) the information that was written to the actionformbean seems to get lost and the jsp presents empty html:text fields. It seems like using the validate=true switch makes the actionformbean to be instantiated again. I can see the reset method is called between the setting of the formbean parameters and the viewing of the jsp because all parameters get the values set in the reset method if set there when using validate=true. All former settings get lost then of course. I do not understand why this is the case. How should the validate switch be used then? Or do I have to write the information that I want to present in a jsp using a actionform always into the session? I thought it should be possible to write it to the actionform inside of the dispatchaction if it is possible to read it from the actionform in the dispatchaction. Can anybody explain to me the best practice is in this case? How does the lifecycle look like of an actionform (for request scope settings in the struts config)? Best regards, Carsten Hammer - 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]
validate= true destroys form defaults
Hi, I use a dispatchaction to set actionform parameters using the actionform setter methods (I do not write it to the session!). The flow is this way: 1. Url: http://localhost:8080/mydispatchaction.do?method=view ;here the information is pulled from the database and put to the actionformbean using its setter methods. 2. This mydispatchaction.do forwards to the jsp. There the information from the database is presented and can be changed and submitted again to the mydispatchaction.do?method=save This all works as expected. Unfortunatly as soon as I switch on the validate switch in the struts config (1.1x) the information that was written to the actionformbean seems to get lost and the jsp presents empty html:text fields. It seems like using the validate=true switch makes the actionformbean to be instantiated again. I can see the reset method is called between the setting of the formbean parameters and the viewing of the jsp because all parameters get the values set in the reset method if set there when using validate=true. All former settings get lost then of course. I do not understand why this is the case. How should the validate switch be used then? Or do I have to write the information that I want to present in a jsp using a actionform always into the session? I thought it should be possible to write it to the actionform inside of the dispatchaction if it is possible to read it from the actionform in the dispatchaction. Can anybody explain to me the best practice is in this case? How does the lifecycle look like of an actionform (for request scope settings in the struts config)? Best regards, Carsten Hammer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validate= true destroys form defaults
This is my be a long shot, but I encountered it before. Makesure to make all your actions to have the same scope In this case: request. Do not leave it blank. ]-D - Original Message - From: Carsten Hammer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 12:01 PM Subject: validate= true destroys form defaults Hi, I use a dispatchaction to set actionform parameters using the actionform setter methods (I do not write it to the session!). The flow is this way: 1. Url: http://localhost:8080/mydispatchaction.do?method=view ;here the information is pulled from the database and put to the actionformbean using its setter methods. 2. This mydispatchaction.do forwards to the jsp. There the information from the database is presented and can be changed and submitted again to the mydispatchaction.do?method=save This all works as expected. Unfortunatly as soon as I switch on the validate switch in the struts config (1.1x) the information that was written to the actionformbean seems to get lost and the jsp presents empty html:text fields. It seems like using the validate=true switch makes the actionformbean to be instantiated again. I can see the reset method is called between the setting of the formbean parameters and the viewing of the jsp because all parameters get the values set in the reset method if set there when using validate=true. All former settings get lost then of course. I do not understand why this is the case. How should the validate switch be used then? Or do I have to write the information that I want to present in a jsp using a actionform always into the session? I thought it should be possible to write it to the actionform inside of the dispatchaction if it is possible to read it from the actionform in the dispatchaction. Can anybody explain to me the best practice is in this case? How does the lifecycle look like of an actionform (for request scope settings in the struts config)? Best regards, Carsten Hammer - 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]