Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts2 validation

Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybodyl.
Firstly sorry about my English.
I've a problem with validation in Struts2 and Maven.
I don't know why Strus2 don't validate the field fom.
It was ok when I haven't Maven in the project.
I have an structure like this:


Part of struts.xml:
<action name="doLogin" class="com.atosorigin.nuba.actions.login">
<result name="input">loginNuba.jsp</result>
<result name="success">/vistas/saludo.jsp</result>
<result name="error">/vistas/error.jsp</result>
</action> has:
email.required= Email obligatorio y con formato correcto.
password.required=Falta la contrasenya

login-validation.xml has:
?xml version="1.0" encoding="UTF-8"?>

<!-- En Struts2 pondremos el nombre de la clase Java y NO EL NOMBRE DE LA ACCION -->

<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"


<field name="userEmail">
<field-validator type="email">
<message key="email.required"/>

<field name="userPassword">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message key="password.required"/>


Has anybody knows the solution to solve this problem?

Best regards.
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic