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)
>         at
> java.security.AccessController.doPrivileged(Native
> Method)
>         at
>
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:850)
>         at
>
java.beans.Introspector.getTargetEventInfo(Introspector.java:556)
>         at
>
java.beans.Introspector.getBeanInfo(Introspector.java:294)
>         at
>
java.beans.Introspector.getBeanInfo(Introspector.java:128)
>         at
>
weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1003)
>         at
>
weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:941)
>         at
>
weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:207)
>         at
>
weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
>         at
>
weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:4177)
>         at
>
weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4018)
>         at
>
weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:3865)
>         at
>
weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2039)
>         at
>
weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1853)
>         at
>
weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1735)
>         at
>
weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1015)
>         at
>
weblogic.servlet.jsp.JspParser.doit(JspParser.java:78)
>         at
>
weblogic.servlet.jsp.JspParser.parse(JspParser.java:181)
>         at
>
weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
>         at
>
weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255)
>         at
>
weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:327)
>         at
>
weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:189)
>         at
>
weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:154)
>         at
>
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:36
> 8)
>         at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :24
> 
=== 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