The ActionMessage class is in the more recent nightly
builds of Struts.  Are you using html:messages?  This
uses that class.  I'm not what else would be looking
for this in a JSP page though.  The validator tags
shouldn't be making a reference to this class.  

To check if the ValidatorResources are loading you can
see something print to the console window if the debug
for the ValidatorServlet is set to greater than 1.  I
would try to get the server side validation working
before testing the client side.  Once the server side
is working, the client side validation shouldn't be a
problem.

David

--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> search the archives for more postings, but I have
> heard different approaches when I posted the same
> problem.
> 
> 1. Check to see that you are using the latest Struts
> nightly build.
> 
> 2. If not using hte latest nightly build, this may
> work if you use Tomcat 4.0
> 
> 3. Remove Jaxp, crimson and parser.jar files and add
> xerces.jar file.
> 
> The first one makes sense to me and the last two I
> am
> puzzled about.
> 
> The main thing is that ActionMessage is a new class
> to
> the nightly builds.  However this may be
> circumvented
> (the use of the ActionMessage) by changing the JSP
> to
> not use the new feature (at least this is what I
> have
> been told).
> 
> Sorry if I am confusing you, but as you can probably
> tell, i myself am confused, but since I do not have
> to
> do the work immediately, I have been holding off
> figuring out exactly what the problem is.
> 
> - Sandeep
> 
> --- Parvaze Suleman <[EMAIL PROTECTED]>
> wrote:
> > Hi 
> > I am trying to use Validator in my application and
> > can not get it to work. I
> > have a single test form that I would like to use
> the
> > Validator for
> > client-side and server-side validation. If I add
> the
> > following
> > 
> > <%@ taglib uri="/WEB-INF/struts-validator.tld"
> > prefix="validator" %>
> > 
> > reference to the taglib to the test form JSP page,
> > when I access this JSP
> > page after deploying the application, I get a
> > NoClassDefFoundError exception
> > thrown (see full message at the end of this
> email).
> > If I remove the taglib
> > reference, I don't get the error but the
> validation
> > rules don't get applied
> > either.
> > 
> > The latest version of the struts-validator.jar
> file
> > and the
> > struts-validator.tld files are in the WEB-INF/libs
> > directory.
> > 
> > Thanks in advance for any help received.
> > 
> >
>
============================================================
> > 
> > 
> > My web.xml file is defined as follows:
> > 
> > .....
> >    <servlet>
> >       <servlet-name>validator</servlet-name>
> >  
> >
>
<servlet-class>com.wintecinc.struts.action.ValidatorServlet</servlet-class>
> >       <init-param>
> >          <param-name>config</param-name>
> >         
> > <param-value>/WEB-INF/validation.xml</param-value>
> >       </init-param>
> >       <init-param>
> >          <param-name>debug</param-name>
> >          <param-value>2</param-value>
> >       </init-param>
> >       <load-on-startup>2</load-on-startup>
> >    </servlet>
> > ....
> > 
> >    <taglib>
> >      
> >
> <taglib-uri>/tags/struts-validator.tld</taglib-uri>
> >      
> >
>
<taglib-location>/WEB-INF/struts-validator.tld</taglib-location>
> >    </taglib>   
> > ....
> > 
> > 
> > My Validation.xml file is defined as below:
> > 
> > <form-validation>
> >    <global>
> > 
> >       <validator name="required"
> >                 
> >
>
classname="com.wintecinc.struts.validation.StrutsValidator"
> >                  method="validateRequired"
> >                  msg="error.required">
> >          <javascript><![CDATA[
> >             function validateRequired(form) {
> >                 var bValid = true;
> >                 var focusField = null;
> >                 var i = 0;
> >                 var fields = new Array();
> >                 oRequired = new required();
> > 
> >                 for (x in oRequired) {
> >                     if
> ((form[oRequired[x][0]].type
> > == 'text' ||
> > form[oRequired[x][0]].type == 'textarea' ||
> > form[oRequired[x][0]].type ==
> > 'select' || form[oRequired[x][0]].type == 'radio'
> ||
> > form[oRequired[x][0]].type == 'password') &&
> > form[oRequired[x][0]].value ==
> > '') {
> >                        if (i == 0)
> >                           focusField =
> > form[oRequired[x][0]];
> > 
> >                        fields[i++] =
> > oRequired[x][1];
> > 
> >                        bValid = false;
> >                     }
> >                 }
> > 
> >                 if (fields.length > 0) {
> >                    focusField.focus();
> >                    alert(fields.join('\n'));
> >                 }
> > 
> >                 return bValid;
> >             }]]>
> >          </javascript>
> >       </validator>
> >    </global>
> >    <formset>
> >       <form    name="personalDetailsForm">
> >          <field    property="fName"
> >                    depends="required,mask">
> >             <arg0  key="label.fname"/>
> >             <msg name="mask"
> > key="prompt.personalDetailsForm.fname.maskmsg"/>
> >             <arg0 key="label.fname"/>
> >             <var>
> >               <var-name>mask</var-name>
> >               <var-value>^[a-zA-Z]*$</var-value>
> >             </var>
> >          </field>
> >       </form>
> >    </formset>
> > </form-validation>
> > 
> > 
> > 
> > 
> > ERROR TEXT
> >
>
======================================================
> > 
> > <01-Nov-01 11:37:51 GMT> <Info> <HTTP>
> > <[WebAppServletContext(2791227,olympus,/olympus)]
> r
> > esolved taglib uri '/WEB-INF/struts-html.tld' to
> > taglib-location
> > /WEB-INF/struts-html.tld:
> > >
> > <01-Nov-01 11:37:52 GMT> <Error> <HTTP>
> > <[WebAppServletContext(2791227,olympus,/olympus)]
> > Servlet failed with Exception
> > java.lang.NoClassDefFoundError:
> > org/apache/struts/action/ActionMessage
> >         at java.lang.Class.getMethods0(Native
> > Method)
> >         at
> >
> java.lang.Class.getDeclaredMethods(Class.java:1039)
> >         at
> >
> java.beans.Introspector$1.run(Introspector.java:852)
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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

Reply via email to