Just a few ideas that came to mind.
1) Make the list something more permanent in nature...session variable.
2) Put the list in your form and pass the form on to the next page.
3) Pull the data from with your jsp using a tag.



_________________________________
Jeremy Nix
Southwest Financial Services, LTD.
[EMAIL PROTECTED]
(513) 621-6699 ext.1158



-----Original Message-----
From: Michael Koss [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 29, 2003 12:08 PM
To: [EMAIL PROTECTED]
Subject: Calling execute() with errors in ActionForm.validate()


Hi. I am having a problem with the "input" attribute to an "action" in
the action-mapping in my struts-config.xml:

<action name="addedit_subtypes"
        path="/addedit_subtypes"
        type="gov.faa.infra.irequest.web.action.AddEditSubTypesAction"
        input="/addedit_subtypes.jsp">
   <forward name="show.edit" path="/addedit_subtypes.jsp"></forward>
   <forward name="show.add" path="/addedit_subtypes.jsp"></forward>
   <forward name="added" path="/view_subtypes.do"></forward>
   <forward name="updated" path="/view_subtypes.do"></forward>
</action>

This action has a dual purpose; it adds new and edits existing subtypes.
Let's only focus on the editing portion now, but I get the same error
when adding.

The first time addedit_subtypes.do is called, it will be passed a
primary key to a subtype to edit -- the ActionForm is populated with the
PK. The action uses the PK to look up a subtype object. Then the action
calls the data layer to get a list of all users and sets the Collection
returned to the request attribute "userList". The display of the subtype
to edit works just fine.

When the user edits the subtype and clicks save, an "action=save"
attribute is passed and there are no problems saving the edited
subtype...unless there is a ActionForm.validate() error. If one of the
fields is empty then a new ActionError object is placed in the
ActionErrors. The input of the action is "addedit_subtype.jsp." When the
page forwards to the JSP, the Action.execute() method is not called,
however this is the method that pulls the list of users. When the JSP is
called, an error is thrown because "userList" has not been defined. I
could use the <logic:present> tag to avoid the error, but then the list
of users would not be presented to the user.

How can I ensure that "userList" will be set even if the validate()
method returns with errors?

Thanks for your help,
Michael.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to