You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Raible, Matt" <Ma...@cable.comcast.com> on 2003/05/13 19:32:47 UTC

Validating a form in a regular servlet

I want to use some core Struts' components in a user registration servlet.
Since I'm protecting the /do/* url-pattern, I've created a simple servlet
that maps to "register".  In this servlet, I'd like to call
userForm.validate(), but I don't have a mapping to pass into the method.  Is
there anyway to "fake" one?

        UserFormEx userForm = new UserFormEx();

        // populate the userForm with request parameters
        RequestUtils.populate(userForm, request);

	  ActionErrors errors = new ActionErrors();

        errors = userForm.validate(mapping,request);  // Need "fake" mapping
to pass in

Thanks,

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org