Re: Validator framework hijacks requests! :(

2005-11-19 Thread Raghu Kanchustambham
Thanks Laurie. Just curious.. should Struts ideally not warn me against this? When I define that something needs to be validated and there is no validate method or doesnt implement/declare the correct interface or class... it should have cribbed and told me so. This reminds me of experiences

[OT] Re: Validator framework hijacks requests! :(

2005-11-19 Thread Dave Newton
Raghu Kanchustambham wrote: This reminds me of experiences programming in the primitive typeless languages! Primitive like... um... Python? Ruby? Lisp? i accidentally named my file as validations.xml (plural) and declared it as validation.xmlin struts-config. And it took me a lot of effort

Re: Validator framework hijacks requests! :(

2005-11-19 Thread Laurie Harper
Raghu Kanchustambham wrote: Thanks Laurie. Just curious.. should Struts ideally not warn me against this? When I define that something needs to be validated and there is no validate method or doesnt implement/declare the correct interface or class... it should have cribbed and told me so. This

Re: Validator framework hijacks requests! :(

2005-11-18 Thread Raghu Kanchustambham
Thanks Laurie for the detailed explanation. I am still not able to get the validation working .. after spending almost a frustrating one week on it. Can you help me by telling me what I am doing wrong here... everything seems to be right.. just that it isnt working... :( Bean definition and

Re: Validator framework hijacks requests! :(

2005-11-18 Thread Laurie Harper
One thing jumps out right off: your form bean is a DynaActionForm. It needs to be an instance of ValidatorActionForm for validation to occur; either DynaValidatorActionForm form or, probably, DynaValidatorForm. If that doesn't work, I'd suggest adding a simple String-type property to the form

Re: Validator framework hijacks requests! :(

2005-11-16 Thread Laurie Harper
Raghu Kanchustambham wrote: Thanks Laurie. It works with the way you suggested. But it makes a lot of things clumsy.. 1. I need to have different action class mappings potentially for each of the CRUD operations... though all of them use the same dispatch action class. Well, only for each

Re: Validator framework hijacks requests! :(

2005-11-15 Thread Raghu Kanchustambham
Thanks Laurie. It works with the way you suggested. But it makes a lot of things clumsy.. 1. I need to have different action class mappings potentially for each of the CRUD operations... though all of them use the same dispatch action class. 2. I still havent figured out a way where you need to

Re: Validator framework hijacks requests! :(

2005-11-13 Thread Laurie Harper
The easiest way is probably to split your action mapping out into two mappings, one for the operations that should have validation applied and one for the setup operations that shouldn't. Set validate=false on the mapping for the setup operations, and make it the input for the other mapping

Validator framework hijacks requests! :(

2005-11-12 Thread Raghu Kanchustambham
I think I can explain it now. I hit the action servlet first invoking preCreate function. This function populates various lists of beans needed for dropdowns and put these lists in the request object and forward to a JSP. The JSP reads these lists and displays the dropdowns. So far so good!

Re: Validator framework hijacks requests! :(

2005-11-12 Thread Paul Benedict
There's nothing wrong with ussing session scoped forms. You can attached these lists right to the form, if you want - just make sure you remove the form from memory when you're finished. --- Raghu Kanchustambham [EMAIL PROTECTED] wrote: I think I can explain it now. I hit the action servlet

Re: Validator framework hijacks requests! :(

2005-11-12 Thread Raghu Kanchustambham
Thanks.. may be i will do it as a last option. But is my explanation correct? I am new to Validation framework .. just started using it for the last 2 days .. and struts as such for just over a month. So want someone's opinion on my explanation of why state is being lost! thanks raghu On

Re: Validator framework hijacks requests! :(

2005-11-12 Thread Paul Benedict
What is preCreate? Is that a method you have? Know that the validator will not call your action if a validation error has occured. --- Raghu Kanchustambham [EMAIL PROTECTED] wrote: Thanks.. may be i will do it as a last option. But is my explanation correct? I am new to Validation framework

Re: Validator framework hijacks requests! :(

2005-11-12 Thread Laurie Harper
The trick is to only include validation on the data processing actions, not on the pre-display actions (i.e. use validate=false on your preCreate action mapping, and only put validate=true on the action you submit the form to). Then set the 'input' attribute for your validating actions to

Re: Validator framework hijacks requests! :(

2005-11-12 Thread Raghu Kanchustambham
Thanks Laurie for the suggestion. Then set the 'input' attribute for your validating actions to point to the pre-population action (so when validation fails, Struts forwards to preCreate, not directly to the JSP). That explains why the request variables are getting wiped off! :-) I realize I