You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jörg Bostelmann <Jo...@hmmh.de> on 2012/02/10 17:33:56 UTC

Validation FieldErrors missing after Struts2 Update (2.1.8 to 2.3.1.2)

Hello List subscribers,

after an Update of Struts2 from version 2.1.8 to 2.3.1.2 the validation field error messages are missing in the frontend. But the validation takes place. The field errors are not transferred to the jsp.

Some more details:

This way we are adding the field error:
try {
	userModel = checkCredentials(StringUtils.lowerCase(this.loginName), this.pwd);
} catch (final InvalidCredentialsException e1) {
   	addFieldError(FIELDNAME_LOGINNAME, getText("login.form.wrong.credentails"));
	forward = INPUT;
}

These are the corresponding lines in the struts.xml:
<result name="input" type="chain">
	<param name="actionName">ShowProduct</param>
	<param name="productCode">${productCode}</param>
	<param name="tab">review</param>
</result>

And the interesting part of the jsp:
<s:textfield cssClass="form-field02" id="email" name="loginName" cssErrorClass="error" autocomplete="off" />
<s:fielderror id="errorEmail" cssClass="error-message-left03" fieldName="loginName" escape="false" />

This jars we are using (we don´t use maven in our project):
commons-beanutils-1.8.0.jar
commons-codec-1.5.jar
commons-digester-1.8.1.jar
commons-fileupload-1.2.1.jar
commons-io-1.3.2.jar
etrackerbean.jar
facebook-java-api-3.0.2.jar
freemarker-2.3.18.jar
jackson-all-1.8.6.jar
jackson-mapper-lgpl-1.0.0.jar
jcaptcha-1.0-all.jar
jcaptcha4struts2-2.0.2.jar
jdom-1.1.jar
json-20080701.jar
ognl-3.0.4.jar
org.springframework.web.servlet-3.0.0.RELEASE.jar
rome-1.0.jar
struts2-core-2.3.1.2.jar
struts2-json-plugin-2.3.1.2.jar
struts2-rome-plugin-0.3.jar
struts2-spring-plugin-2.3.1.2.jar
struts2-ssl-plugin-1.2.jar
struts2-tiles-plugin-2.3.1.2.jar
tiles-api-2.1.4.jar
tiles-core-2.1.4.jar
tiles-jsp-2.1.4.jar
tiles-servlet-2.1.4.jar
urlrewrite-2.6.0.jar
xebia-servlet-extras-1.0.4.jar
xwork-core-2.3.1.2.jar

I tried to use result type "redirectAction" instead of "chain". But the field errors are still not available in the jsp. There is no exception showing up in the console. After some investigation my assumption is that the new struts version is not compatible with the tiles version we use. But we have many bindings to the tiles version we use. An colleague said that also freemarker (templates) could be the course of the problem... Does anyone of you have an idea how to solve the problem?

Thanks in advance,
Jörg Bostelmann






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validation FieldErrors missing after Struts2 Update (2.1.8 to 2.3.1.2)

Posted by Maurizio Cucchiara <mc...@apache.org>.
Hi Jorg,
according to the docs [1] you should use
struts.xwork.chaining.copyFieldErrors - set to true to copy Field Errors

[1]
http://struts.apache.org/2.3.1.2/xwork-core/apidocs/com/opensymphony/xwork2/interceptor/ChainingInterceptor.html

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara


On 10 February 2012 17:33, Jörg Bostelmann <Jo...@hmmh.de> wrote:

> ShowProduct