Problem with Struts2 Validator (doesn't parse)

Hi all! I'm trying to create a validator for this form:

<s:form namespace="/user" action="create" validate="true">

<s:textfield id="nameUser" name="user.nameUser" label="Nombre"/>

<s:textfield id="surname" name="user.surname" label="Apellidos"/>

<s:textfield id="address" name="user.address" label="Direccin"/>

<s:textfield id="cif" name="user.cif" label="CIF"/>

<s:textfield id="email" name="user.email" label="Email"/>

<s:textfield id="telephoneNumber" name="user.telephoneNumber" label="Telfono"/>

<s:textfield id="password" name="user.password" label="Password"/>

<s:submit/>

</s:form>

And the validator is UserAction-create-validation.xml that:

<!DOCTYPE validators PUBLIC

"-//OpenSymphony Group//XWork Validator 1.0//EN"

"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>

<field name="user.nameUser">

<field-validator type="requiredstring">

<message>Se requiere nombre de usuario</message>

</field-validator>

</field>

<field name="user.password">

<field-validator type="requiredstring">

<message>Se requiere contrasea</message>

</field-validator>

</field>

</validators>

But it doesn't work. Even if I include XML mistakes such "<validatorIHATETHISCRAPs>29023023" always is deployed fine in my tomcat server.

The validator is in the same package that my UserAction.java (which includes the method "create")

Could be problem of my web.xml?

<?xml version="1.0" encoding="UTF-8"?>

<web-app id="modern-syndicator" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<filter>

<filter-name>struts2</filter-name>

<filter-class>

org.apache.struts2.dispatcher.FilterDispatcher

</filter-class>

</filter>

<filter-mapping>

<filter-name>struts2</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

<welcome-file-list>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/config/applicationContext.xml

</param-value>

</context-param>

<listener>

<listener-class>

org.springframework.web.context.ContextLoaderListener

</listener-class>

</listener>

</web-app>

Of course, following tutorials from the beginning all works fine, but in this project, more complex, doesn't work properly.

Thanks in advance and sorry about my English.

[3900 byte] By [lordfergusona] at [2007-11-27 11:04:07]
# 1

Whops, I reply myself!

It was problem of a portion my struts.xml:

<package name="modern" extends="struts-default">

* <interceptors>

<interceptor-stack name="modernStack">

<interceptor-ref name="basicStack"/>

</interceptor-stack>

</interceptors>

<default-interceptor-ref name="modernStack"/>*

</package>

Just commenting between *s and it works (or changing basicStack for defaultStack, I think)

Thanks lordferguson!

lordfergusona at 2007-7-29 12:55:54 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...