You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sue Deng <sd...@covalent.net> on 2001/04/27 21:01:11 UTC

ActionForm validation

Hi,

I am trying to use my ActionForm object to perform simple validations.
If validation fails, I think the controller servlet will forward control
bake to the input form with whatever the user has entered.  For example,
8 characters is required for a field, but user just entered 4
characters.  Those 4 characters should be in the input text field in the
input form, but it gave me a blank field.

I use struts taglib.  It looks like this in a input form:

.......
<html:form name="ipForm" action="ip.do"
type="net.covalent.........IPForm">
<html:text property="ip"
........

where "ip" is a variable field in IPForm class

I was wondering if the scope of ActionForm bean is "request" or
"session".  In struts user guide, section 3.3.1, it reads "It (HTML
<form> element) also associates all of the fields within the form with a
session scoped FormBean that is stored uner the key ..."  So, where can
I set the scope the the ActionForm bean?

Thanks,

-Sue