Al Sutton-4 wrote:
> 
> Ok, Looks like the first part is confusion in terminology. I took Action
> to
> mean an action as defined in struts.xml, but I now see Richard meant a
> single class used to declare two actions. 
> 
> Your solution to the second part doesn't seem right to me. My
> understanding
> of things is that if struts validation was enabled and it failed
> validating
> one of the form parameters the submit method would not get called and thus
> the list would not be re-populated before the user is sent back to the
> input
> page. So it isn't right for me because I'm looking for something which
> allows action message passing between actions and allows validation to be
> enabled.
> 
> Thanks for the suggestion though.
> 


you could work around that in this way, a little wonky, but still
sustainable:

public class AwesomeAction extends ActionSupport implements Preparable,
Validateable {
 
  List awesomeList;
  AwesomeService awesomeService;
 

  public void preparePrep  /* how droll! */ () {  
 
     awesomeList = awesomeService.getList();
  }

  public void validateSubmit() {
     if ( hasErrors() ) { 
      preparePrep();
     }
  }
 
  public string prep() {
     return SUCCESS;
  }

  public String submit() {
     [do eet];
  }
}

-- 
View this message in context: 
http://www.nabble.com/-s2.0.9--Is-there-a-better-way-to-do-this...-tf4391572.html#a12526913
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to