Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Miguel Almeida
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The general idea is (as per 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!