struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David G. Friedman" <hum...@ix.netcom.com>
Subject RE: Validation seemingly not getting called any longer
Date Wed, 09 Nov 2005 03:54:28 GMT
Preston,

It is great to hear you've identified your problem.  I'd just been looking
over my examples and couldn't find anything out of place with the
code/xml/config samples you'd included.

Now, about your multiple module problems, I tried to find an old link to the
(wiki?/faq?) page listing things to watch out for when you use modules or
multiple struts-config.xml files but I can't find it.  Perhaps someone else
can send you that link so you'll know what else to watch out for when using
multiple (or module based) struts-config.xml files.

Regards,
David

-----Original Message-----
From: Preston CRAWFORD [mailto:Preston.Crawford@state.or.us]
Sent: Tuesday, November 08, 2005 9:27 PM
To: user@struts.apache.org
Subject: RE: Validation seemingly not getting called any longer


Solved it. Weird.

I rolled back to an old version to try to figure out what was
different. And the 1 thing that was different is that I'd created a
second struts config and second validation. So my web.xml turned into
this..

        <servlet-name>ourproject</servlet-name>

<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>
                /WEB-INF/struts-config.xml,
                /WEB-INF/subproject/struts-config.xml,
            </param-value>
        </init-param>

And within that other struts-config.xml I had this

    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
       <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/subproj
ect/struts-config.xml"/>
    </plug-in>

Apparently that was the wrong way to go about it, because the second
validator plugin call overrides the first.

Lesson learned.

Preston

>>> Preston.Crawford@state.or.us 11/8/2005 5:07 PM >>>
Thanks for the help everyone.

David,

As far as the issue of timing, users, etc. this is a site in
development. So about 4 developers are working continuously on the
site
and so it's definitely something that happened as a result of a change
by another developer, but I can't put my finger on what it is. I don't
know when it occurred. It just doesn't validate right now. All jars
are
the same.

loginForm extends the ValidatorForm.

What else? I found the place where seemingly my one rule (I commented
the others out) gets loaded for the form...

DEBUG [main] (ValidatorResources.java:192) - Adding FormSet 'FormSet:
language=n
ull  country=null  variant=null
   Form: loginForm
        Field:
                key = username
                property = username
                indexedProperty = null
                indexedListProperty = null
                depends = required
                page = 0
                fieldOrder = 0
                Vars:

Does that look right? This is what sets it up.

validation.xml
    <formset>
        <form name="loginForm">
            <field property="username" depends="required">
                <arg key="loginForm.username"/>
            </field>
        </form>
    </formset>

struts-config.xml
        <form-bean name="loginForm" type="oururl.form.LoginForm"/>

and later...
        <action path="/loginSubmit"
type="oururl.action.LoginSubmitAction" scope="request"
name="loginForm"
validate="true" input=".login">
            <forward name="success" path="/chooseProfileDisplay.do" />
            <forward name="failure" path=".login" />
        </action>


So I don't know what to do at this point. It all seems to be setup
right.

Preston

>>> humble@ix.netcom.com 11/8/2005 4:21 PM >>>
Preston,

1. Did the problem occur after a web application server (Jetty,
Tomcat,
JBoss, etc.) shutdown/startup cycle or while the application was
running
uninterrupted?

2. Have you changed ANY jar files in the webapp or any class files?
Anything which could have caused a spontaneous webapp reload?  The log
files
in your container should indicate a shutdown/restart.

3. I see your action is listed (in a previous post) as with the form
name
"loginForm".  Does that form extend ValidatorActionForm?  And what is
your
struts-config.xml form-bean definition?

4. Are there any other developers for this site?

5. What are the file datestamps/timestamps on teh web.xml,
struts-config.xml, validation.xml, validator-rules.xml, etc.  Are they
recent (as in someone might have modified them before the last webapp
restart) or dated months ago (indicating no recent changes) ?

Regards,
David

-----Original Message-----
From: Preston CRAWFORD [mailto:Preston.Crawford@state.or.us]
Sent: Tuesday, November 08, 2005 7:05 PM
To: user@struts.apache.org
Subject: Re: Validation seemingly not getting called any longer


It's not configured in Validation.xml. The form is....

    <formset>
        <form name="loginForm">
            <field property="username" depends="required">
                <arg key="loginForm.username"/>
            </field>
            <field property="password" depends="required,mask">
                <arg key="loginForm.password"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^[0-9a-zA-Z]*$</var-value>
                </var>
            </field>
        </form>

I did turn up debugging on log4j.logger.org.apache.commons.validator
and log4j.logger.org.apache.struts and the interesting thing is that I
don't see the form validation getting built or initialized. What would
that look like? I wonder why that would not be occurring.

Preston

>>> wsmoak@gmail.com 11/8/2005 3:23 PM >>>
On 11/8/05, Preston CRAWFORD <Preston.Crawford@state.or.us> wrote:
> I have that. Either way the bottom line for me is it flys past
> validation, message or no message. So I need to figure out why that
is
> happening.

What _type_ of Action is LoginSubmitAction and How is it configured in
validation.xml?

What's in the log files at application startup?  Turn logging up to
'debug' and you should see the validation config files being used to
configure validation for each form.

If the config looks right and there's nothing interesting in the log
files, try stepping through the code in a debugger.  JSwat is my
favorite, though I'm still getting used to the new version (and need
to update the instructions...)

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?TomcatDebug

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


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


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


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


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


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


Mime
View raw message