Register / Login
Getting MessageResources in ActionForm Validate
posted 8 years ago
This question might have been asked many times but I have tried googling for sites but found no answers yet.
I just want to know on how I can have a reference on the nice MessageResources class of
in my action form validate method so
I wont hardcode my messages?
I have tried the following code but it was deprecated already.
MessageResources resource= (MessageResources)request.getAttribute(Action.MESSAGE_KEY);
I also found this piece of code but it keeps on returning null messageresource object.
MessageResources resource= (MessageResources)request.getAttribute(Globals.MESSAGE_KEY);
I know I can get it from my action class but I need to know if I could access it in both the validate and reset method of the action form. Thanks!
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
rocket mass heater
Getting MessageResources inside ActionForm
Getting values from properties in validate-using multiple message-resources in struts
Reading the message resources from a form class
Struts validation not displaying error messages
Struts Message resources