Java

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Configuring Struts Validator with Multiple Modules

    1 answers - 1563 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    I have a struts 1.2.9 app that has several modules (assume they are
    named "a" and "b"). In my struts-config-a.xml file, I have a form
    defined as followed:
    <form-bean name="formRegister"
    type="" />
    My validation.xml file looks like:
    <form-validation>
    <formset>
    <form name="formRegister" >
    <field property="registerName" depends="required">
    </field>
    </form>
    </formset>
    </form-validation>
    When I try to access the form, I get:
    Resources cannot be null.
    at
    <init>(Validator.java:188)
    at
    (Resources.java:475)
    at
    (ValidatorForm.java:10
    4)
    Based on some other posts, I think this is telling me it can't find any
    validation information for my form ("formRegister")-which I assume means
    that the name specified in my <formtag is not what validator expects
    to see for form within a module. I've tried "a.formRegister" in my
    <formtag and that doesn't seem to work either.
    I currently have a single validation.xml file. The plugin is configured
    in the main struts-config.xml file. I assume I can only have one
    incarnation of the validator plugin. Is there something I need to put
    in the individual module configuration files? Do I really need to have
    several invocations of the plugin?
    Can someone give me some hints on configuring validator in a
    multi-module struts app?
    Thanks
    Scott
  • No.1 | | 1821 bytes | |

    9/14/06, Scott Smith <ssmith (AT) mainstreamdata (DOT) comwrote:
    I have a struts 1.2.9 app that has several modules (assume they are
    named "a" and "b"). In my struts-config-a.xml file, I have a form
    defined as followed:

    <form-bean name="formRegister"
    type="" />

    My validation.xml file looks like:

    <form-validation>
    <formset>
    <form name="formRegister" >
    <field property="registerName" depends="required">
    </field>
    </form>
    </formset>
    </form-validation>

    When I try to access the form, I get:

    Resources cannot be null.
    at
    <init>(Validator.java:188)
    at
    (Resources.java:475)
    at
    (ValidatorForm.java:10
    4)

    Based on some other posts, I think this is telling me it can't find any
    validation information for my form ("formRegister")-which I assume means
    that the name specified in my <formtag is not what validator expects
    to see for form within a module. I've tried "a.formRegister" in my
    <formtag and that doesn't seem to work either.

    I currently have a single validation.xml file. The plugin is configured
    in the main struts-config.xml file. I assume I can only have one
    incarnation of the validator plugin. Is there something I need to put
    in the individual module configuration files? Do I really need to have
    several invocations of the plugin?

    Yes, you need to configure the validator plugin for each module.

    Niall

    Can someone give me some hints on configuring validator in a
    multi-module struts app?

    Thanks

    Scott

    To unsubscribe, e-mail: user-unsubscribe (AT) struts (DOT) apache.org
    For additional commands, e-mail: user-help (AT) struts (DOT) apache.org

Re: Configuring Struts Validator with Multiple Modules


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Java"

EMSDN.COM