velocity-user mailing list archives

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

Hi,
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">	
#end	

And I am writing the validation.xml file
<!DOCTYPE validators PUBLIC
        "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
        "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

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

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>
        </action>


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

Regards
suresh 

-- 
View this message in context: http://www.nabble.com/Please-sugest-how-to-do-the-macro-validation-in-velicity-tf3900259.html#a11056912
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Mime
View raw message