struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea M" <andrea.missin...@fastwebnet.it>
Subject R: Maintaining form data across pages...
Date Sun, 16 May 2004 10:10:58 GMT
Hi
I'm not sure I've understood properly what you need
What I understand is that you are trying to populate the same actionform
using several pages.
The problem is that struts *always calls reset()* every time it access the
form.
What you can do is making your pages set a flag in the request, so your form
can know where it's called from.
Reset() method takes httpServletRequest as parameter, so you can implement
conditional logic there... sometimes like:

public void reset(ActionMapping mapping, HttpServletRequest request) {
	// first time accessed so I can set everything to null 
	if (request.getParameter("flag") == null) { 
		// set all properties to null here
	}
	else if (request.getParameter("flag").equals("page1") {
		// set to null only properties not present in page1
	}
	else if (request.getParameter("flag").equals("page2") {
		// set to null only properties not present in page2
	}
	...
}

-----Messaggio originale-----
Da: Ayoub, Ashraf A [mailto:ashraf.ayoub@aramco.com] 
Inviato: domenica 16 maggio 2004 11.58
A: Struts Users Mailing List
Oggetto: Maintaining form data across pages...

Dears,

I am trying to setup a series of jsp pages (requestForm, confrimation
jsp). 

I set the scope of my requestForm to "session" as to maintain the data
across the various jsps, but I get it as if reset is called, after  the
confirmation page submits.

What is the best way to maintain the request data across several jsp
pages, speically I have lots of pages as step 1, step 2, step 3 before
submiting the action, with different form beans.

 

 

Thanks, best regards

 

Ashraf Fouad

 



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


Mime
View raw message