Hello everyone -- this is my first post. I'm hoping you can help with a
problem. I've seen bits and pieces of this question asked, but not
entirely...

Here's my problem:

When the user enters data into a 'enter search parameters' form and
validation fails, I don't want the URL to proceed to the 'perform the
search' action. This means I have to use redirecting forwards for the
'input' attribute.

However, with redirects... if I understand correctly... it's not good
enough to store validation errors in the request attributes. They need
to go into session scope. My problem is figuring out where this should
happen.

Experimentally, I now mask validate(), which basically does

  errors = super.validate();
  request.getSession().setAttribute(ERROR_KEY, errors);
  return errors;

but this feels rather nasty to me; validate() is supposed to return
values, not cause side-effects... right?

The problem is that RequestProcessor.java is entirely atomic all the way
from calling validate() to performing the redirect. Is there some other
way to do this that I'm missing? ... or should I not be doing what I'm
doing? Is there some other way to get redirection to work, with the
validator framework?

Appreciate any help --

Par Winzell
Madison, WI



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to