Hi,

I'm trying to use the Struts validator to validate some input parameters.

The problem is that no matter what I do the parameters are always valid, I've tried removing newsId from the url, and it's still valid. If it makes any difference ( which I hope it doesn't ), I want to validate parameters passed via an url, such as:

/admin/news?method=edit&newsId=1

I've looked at all examples/tutorials I can find but I can't for the life of me see what's wrong.

My validation.xml looks like:
<form-validation>

    <form-set>

        <form name="EditNewsForm">
            <field
                property="newsId"
                depends="required,integer">
                <arg0
                    key="typeForm.integer.displayname"/>
                <arg1
                    name="intRange"
                    key="${var:min}"
                    resource="false"/>
                <arg2
                    name="intRange"
                    key="${var:max}"
                    resource="false"/>
                <var>
                    <var-name>min</var-name>
                    <var-value>10</var-value>
                </var>
                <var>
                    <var-name>max</var-name>
                    <var-value>20</var-value>
                </var>
            </field>
        </form>

    </form-set>

</form-validation>

My ActionMapping looks like:
<action path="/admin/news"
   parameter="method"
   type="com.snusk.actions.admin.NewsAction"
   name="EditNewsForm"
   validate="false"
   scope="request">
 [ some forwards ]
</action>

My ActionForm:

<form-bean
    name="EditNewsForm"
    type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="newsId"
        type="java.lang.Long"/>
</form-bean>

regards,
/Magnus Sjöstrand


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to