You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Mixon <rn...@custco.biz> on 2003/06/08 05:59:05 UTC

is screwed up by xdoclet method overrides

(Sorry for the cross-posts. This is definitely an xdoclet problem, but I can
see how a fix/workaround could come from the Struts Validator or Hibernate
perspective also.)

I have a class hieararchy that is four levels deep in places. It works well,
generating my Struts config file, validation file, tablibs, and Hibernate
mapping files ... with one exception.

Here is the portion of the hierarchy that causes the problem.

 BaseObject\
           |-->BaseObjectNameKeyed
           |
           |-->BaseObjectOwnerNameKeyed

There is a property "name" on BaseObject. It has @struts.validator tags for
a required and maxlength validation, and also @hibernate.property tags.
However I need to override the "getName" method in BaseObjectNameKeyed and
BaseObjectOwnerNameKeyed in order to add a single @hibernate.column tag to
specify retrieval indexes for the database.

The most obvious problem occurs in my Struts validator descriptor. They end
up having an extra "<arg1..." tag after the correct one (the entire field
validation is at the bottom of this post). This screws up my maxlength
validation in that the error message says "Name can not be greater than
characters"  instead of "Name can not be greater than 24 characters

Is there a way to fix this? Its not something I can easily use and ant
"replace" to fix. Or is there a different approach that might solve the
problem?

Thanks - Richard

BEGIN EXAMPLE
  <formset>
      <form name="formPoRoleForm">
              <field property="name"
                     depends="required,maxlength">
                  <msg name="required"
                    key="errors.required"/>
                  <msg name="maxlength"
                    key="errors.maxlength"/>
                  <arg0 key="formPoRoleForm.name"/>
                  <arg1 name="maxlength"
                    key="${var:maxlength}"
                      resource="false"/>
                  <arg1 name="maxlength"
                    key="false"/>
                  <var>
                    <var-name>maxlength</var-name>
                    <var-value>24</var-value>
                  </var>
              </field>
              ...
END EXAMPLE



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