Hi Andrew, All of my struts actions have the redirect flag as false. Here is more of my configurtion code which is used to run the application I am running. Would be most appreciative if you could have a look.
Cheers Rodney CODE: Below the code you see is part of an application I am building. The problem here lies in the fact that in all cases, field data does not get redisplayed within the form the user has entered data in. eg. if you enter a invalid data within a numeric data field (this instance ACN) then the ActionForm issues a error message gets issued (works) but the ACN previously entered does not get redisplayed in the form. eg. if you enter a valid ACN or Organisation Name within the fields to do searches, and no data is applicable to the search criteria entered a error message gets issued (works) but no ACN/Organisation Name gets redisplayed in the form where the data was entered. Part 1: Sample Configuration (struts-config.xml) <form-bean name="company.OrganisationNameSearchActionForm" type="net.natdata.application.itf.insolvency.company.OrganisationNameSearchActionForm" /> <global-forwards> <forward name="error" path="/Error.jsp" /> </global-forwards> <action path="/company/OrganisationNameSearch" type="net.natdata.application.itf.insolvency.company.OrganisationNameSearchAction" name="company.OrganisationNameSearchActionForm" input="/company/OrganisationNameSearch.jsp" scope="request" validate="true" parameter="method"> <forward name="next" path="/company/OrganisationBrowse.jsp" redirect="false" /> <forward name="failure" path="/company/OrganisationNameSearch.jsp" redirect="false" /> </action> <action path="/company/OrganisationBrowse" type="net.natdata.application.itf.insolvency.company.OrganisationBrowseAction" name="company.OrganisationBrowseActionForm" input="/company/OrganisationBrowse.jsp" scope="request" validate="true" parameter="method"> <forward name="previous" path="/company/OrganisationNameSearch.jsp" redirect="false" /> <forward name="next" path="/company/OrganisationDetails.jsp" redirect="false" /> <forward name="bill" path="/BillingAction.do" redirect="false" /> <forward name="failure" path="/company/OrganisationBrowse.jsp" redirect="false" /> </action> <controller nocache="true" processorClass="net.natdata.application.itf.framework.NDCRequestProcessor" /> <message-resources parameter="resources.application" /> PART 2: Application form code (validation and reset methods) public class OrganisationNameSearchActionForm extends ActionForm { // Get and Set methods .... public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if(method.equals("Next")) { if((organisationName == null) || (organisationName.trim().equals(""))) { errors.add("organisationName", new ActionError("error.organisationName.required")); } if((ACN != null) && (!ACN.trim().equals(""))) { try { Integer.parseInt(ACN); } catch(NumberFormatException e) { errors.add("ACN", new ActionError("error.ACN.format")); } } } return errors; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.method = null; this.organisationName = null; this.ACN = null; } } Part 3: Action Code (Sample) public class OrganisationNameSearchAction extends LookupDispatchAction { protected java.util.Map getKeyMethodMap() { Map map = new HashMap(); map.put("button.next", "next"); return map; } public ActionForward next(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { boolean error = false; boolean failure = false; String target = "next"; ActionErrors actionErrors = new ActionErrors(); try { HttpSession session = request.getSession(false); if(session != null) { OrganisationNameSearchMessageDTO organisationNameSearchResult = performOrganisationNameSearch(form, session); if(organisationNameSearchResult == null) { error = true; } else if(organisationNameSearchResult.getRequestRejectionGroup() != null) { if(organisationNameSearchResult.getRequestRejectionGroup().getRejectionDetailsSegment() != null) { failure = true; } } if(!error && !failure) { processResults(organisationNameSearchResult, session); target = "next"; } else if(failure) { String errorMsg = organisationNameSearchResult.getRejectionMessage(); actionErrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errorMessage", errorMsg)); target = "failure"; } else { target = "error"; } } else { actionErrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.noSession")); target = "error"; } } catch(Exception e) { target = "error"; } finally { // Save errors if needed and forward to the appropriate page to display if(!actionErrors.isEmpty()) { saveErrors(request, actionErrors); } return (ActionForward)mapping.findForward(target); } } -----Original Message----- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Friday, 5 September 2003 11:38 AM To: Struts Users Mailing List Subject: RE: Redisplaying of entered form fields Firstly check that redirect is false in the forward to the view. (If it is already false then thats not the problem and you should post some more of your code and configs so we can try and see whats going wrong.) -----Original Message----- From: Rodney Paul [mailto:[EMAIL PROTECTED] Sent: Friday, 5 September 2003 09:31 To: Struts Users Mailing List (E-mail) Subject: Redisplaying of entered form fields Hi All, I have a problem redisplaying form fields a user enters within a html form. I use the validate method to validate form entry fields through ActionForms. and validate business logic in LookupDispatchAction classes. Has anyone experienced this problem, and is there any solution to this matter. Cheers Rodney --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]