You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sebastian F. Martin" <me...@sebastianmartin.net> on 2003/07/30 18:29:05 UTC

newbie-question: validation across multiple pages

Hi all,

I've been studying the mailing list but couldn't find anything that
would help me. I'd be grateful if someone could give me a hint on this:

I am collecting user input across multiple pages and validate it in the
validate() method of the ActionForm. If an input field on the second or
the third page is empty after submit, the framework will take me back to
the first page. How can I make him turn me back to the page where the
input field was left blank?

Greetings
Sebastian



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


RE: newbie-question: validation across multiple pages

Posted by Yansheng Lin <ya...@isogis.com>.
You might want to use session to store all the values entered in page=1.
Then when there is an error in page=2 or page=3, and forward the control 
back to page=1.  Since all the values are session scope, you can access them
in your page=1.  Remember you have to clean the session though:).

	if(! errors.isEmpty()) {
		...
		return (new ActionForward("page1"));	
	}


-----Original Message-----
From: Sebastian F. Martin [mailto:me@sebastianmartin.net] 
Sent: July 30, 2003 10:29 AM
To: struts-user@jakarta.apache.org
Subject: newbie-question: validation across multiple pages


Hi all,

I've been studying the mailing list but couldn't find anything that
would help me. I'd be grateful if someone could give me a hint on this:

I am collecting user input across multiple pages and validate it in the
validate() method of the ActionForm. If an input field on the second or
the third page is empty after submit, the framework will take me back to
the first page. How can I make him turn me back to the page where the
input field was left blank?

Greetings
Sebastian



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


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