velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tallurisuresh <>
Subject Please sugest how to do the macro validation in velicity
Date Mon, 11 Jun 2007 08:44:49 GMT

I am using the velocity for UI purpose.when i am developing the velocity
pages i am using the macros. now i am validating the velocity page where i
am using the macro's those fields are not validating. I am using the
struts2.0.6 and tomcat6.0 

. I am writing the macro in my velocity page.
#macro (stexttelfield $label1 $label2 $label3)
	<input type="text" name="$label1" size="4">-
	<input type="text" name="$label2" size="4">-
	<input type="text" name="$label3" size="4">	

And I am writing the validation.xml file
<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"

    <field name="username">
        <field-validator type="requiredstring">
            <message key="requiredstring"/>
    <field name="password">
        <field-validator type="requiredstring">
            <message key="requiredstring"/>
    <field name="password1">
        <field-validator type="requiredstring">
            <message key="requiredstring"/>

The struts.xml file action is

<action name="Login" class="example.Login">
            <result type="velocity">example/Login.vm</result>
            <result type="redirect-action">Menu</result>

But the macro fields are not recognise by validation.xml file. so please
suggest me the solution


View this message in context:
Sent from the Velocity - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message