I have a form which I want to prepopulate with some general data (eg. a list or 
provinces) from a database along with some user specific data again from a database 
(eg. user name).  The form is also secure so I want the user to be "logged in" to 
access it.

So I have set up:

Page.jsp - the view containing the form
PageForm.java - extends ActionForm
PageAction.java - extends Action and set in mapping as pageAction.do

In PageAction I check for a session attribute which tells me whether or not the user 
is logged in.  If the user is not logged in I forward them to a login sequence.

The problem is when I call pageAction.do the PageAction is never called.  The reset() 
and validate() methods on PageForm are called but then Page.jsp is displayed without 
ever having called PageAction's perform() and therefore never doing security 
authentication.

So no security validation occurs.  I have no opportunity to prepopulate the form.  I 
did cheat in a way by having reset() set the general data but I still need a way to 
prepulate the personal data that I want pre-filled on the form *once* when it's first 
displayed and then allow the user to change from then on.  So if they change their 
name on the form, for example, but make an error on the form then when the form is 
redisplayed it doesn't reset the name back to what's in the database but instead shows 
the changed name.

In my mapping I have the input attribute set to Page.jsp.  Perhaps I'm misusing this 
attribute.

Thanks for any and all help.

Derek
 

Reply via email to