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
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
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
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
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
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
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
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
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!
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
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
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
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
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
14 matches
Mail list logo