struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xianwinwin <>
Subject struts2: interceptor - validation doesn't work :-(
Date Thu, 03 Jan 2008 23:37:08 GMT

I've been struggling with this issue for a while and any pointer would be

I have a simple file with one field -name; I would like to validate that the
user put information in it.

I'm using the annotation in order to achieve this but for some reason the
validation doesn't work (there's no return message that the user did not
provide the info).

my file looks like this:

	@RequiredStringValidator(message="name is missing")
	public void setName(String name)

in the jsp page:
 <s:textfield name="name" label="your name:" />

in the xml:
        <action name="UserTest_*"  method="{1}"
            <result name="error">/pages/error.jsp</result>            
            <result name="success">/pages/welcome.jsp</result>
            <interceptor-ref name="guest"/>

the guest interceptor is:
            <interceptor-stack name="guest" >
                <interceptor-ref name="defaultStack"/>

any idea?????

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message