File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Populating jsp page when validation fails - problem with s:action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Populating jsp page when validation fails - problem with s:action" Watch "Populating jsp page when validation fails - problem with s:action" New topic
Author

Populating jsp page when validation fails - problem with s:action

Miguel Almeida
Greenhorn

Joined: Mar 12, 2010
Posts: 9
The general idea is (as per https://cwiki.apache.org/WW/how-do-we-repopulate-controls-when-validation-fails.html) to have the following:
1) jsp with a list of items and a "add item" form
2) when validation fails, the list of items should still populate

The method: Add a <s:action name="xxx" executeResult="true"/> to the jsp, that should execute even when the validation fails and sends the action to INPUT
The problem: When helloWorld's validation fails (see below), Action xxx is redirecting to input, and not to SUCCESS, as expected.

Does anyone know why this happen?

A simple /jsp/index.jsp would be (where helloWorld's method is annotated with @RequiredStringValidator):


The action configuration (I've explicitly defined interceptor-ref here to ensure I'm using the default stack) :


Expected: If either the name or date are not filled, the validation fails and sends to input. The contents of centreList.jsp should be shown, however, because that action should be independent. I've even annotated the loadTrialCentres with @SkipValidation
Actual: The contents of xxx.jsp are shown.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Populating jsp page when validation fails - problem with s:action