I need to use @SessionScope to make a list stay in the page after
refreshing, but when I use it, Stripes:error doesn't display error any
more. Stripes:error works actually(error is on a field in which user needs
to input and if the field is empty, error is showing and user can not
submit the form) because the submission is disabled, but it just doesn't
show the error message in the page any more. I think there is something
with @SessionScope because when I run the code without it all the errors
shown in the page. Any Idea of how to fix this?

Note: I also tried to use @Wizard(startEvents="event") and it lets errors
to be shown but doesn't do anything with saving the list in the page!
Here is java code:

@SessionScope
@UrlBinding("/Student/import.action")
public class ImportAction implements ActionBean {

  private List<ImportExcel> importExcel;
    private String userCheckBox;

    public Resolution importStudents() throws IOException {

    try {
    //Here I put data into importExcel list
    } catch {}

      if (userCheckBox == null) {
      if(importExcel.size() > 0) {
      for(String error : importExcel) {
      this.getContext().getValidationErrors().add("userCheckBox",new
SimpleError(error));
      }
      return getContext().getSourcePageResolution();
      }
      }
    return new RedirectResolution("import.action");
}

and here is jsp:

<stripes:checkbox name="userCheckBox"/><stripes:errors
field="userCheckBox"/><stripes:submit name="importStudents"
value="Import"/>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to