关于validation.xml文件

 

环境eclipse3.2+myeclipse6.0,tomcat5.5.23

用struts框架的validate验证的时候在validation.xml个文件中没有写

 

<! DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd"
>

 

 

在启动tomcat的时候报错,解决方法:在validation.xml文件中加上以上代码

如果tomcat是5.0就没有问题;

以下是出错信息

 

[ framework ]   2008 - 08 - 14   14 : 26 : 50 , 494  - org.apache.commons.digester.Digester - 2000   [ main ]  ERROR org.apache.commons.digester.Digester  - Parse Error at line  1  column  17 : Document is invalid: no grammar found.
 org.xml.sax.SAXParseException: Document is invalid: no grammar found.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
195 )
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:
131 )
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:
384 )
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:
318 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:
250 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:
626 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:
3084 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:
912 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:
645 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:
140 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:
508 )
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
807 )
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
737 )
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
107 )
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
1205 )
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:
522 )
    at org.apache.commons.digester.Digester.parse(Digester.java:
1591 )
    at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:
159 )
    at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:
237 )
    at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:
162 )
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:
869 )
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:
336 )
    at javax.servlet.GenericServlet.init(GenericServlet.java:
212 )
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
1139 )
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
966 )
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3956 )
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:
4230 )
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
760 )
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
740 )
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
544 )
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:
920 )
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
883 )
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
492 )
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:
1138 )
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
311 )
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
120 )
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1022 )
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:
736 )
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1014 )
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443 )
    at org.apache.catalina.core.StandardService.start(StandardService.java:
448 )
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:
700 )
    at org.apache.catalina.startup.Catalina.start(Catalina.java:
552 )
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39 )
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25 )
    at java.lang.reflect.Method.invoke(Method.java:
597 )
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:
295 )
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:
433 )
[ framework ]   2008 - 08 - 14   14 : 26 : 50 , 494  - org.apache.commons.digester.Digester - 2000   [ main ]  ERROR org.apache.commons.digester.Digester  - Parse Error at line  1  column  17 : Document root element  " form-validation " ,  must match DOCTYPE root  " null " .
 org.xml.sax.SAXParseException: Document root element 
" form-validation " ,  must match DOCTYPE root  " null " .
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
195 )
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:
131 )
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:
384 )
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:
318 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:
256 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:
626 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:
3084 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:
912 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:
645 )
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:
140 )
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:
508 )
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
807 )
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:
737 )
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
107 )
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
1205 )
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:
522 )
    at org.apache.commons.digester.Digester.parse(Digester.java:
1591 )
    at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:
159 )
    at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:
237 )
    at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:
162 )
    at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:
869 )
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:
336 )
    at javax.servlet.GenericServlet.init(GenericServlet.java:
212 )
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:
1139 )
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:
966 )
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3956 )
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:
4230 )
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
760 )
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
740 )
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
544 )
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:
920 )
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
883 )
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
492 )
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:
1138 )
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
311 )
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
120 )
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1022 )
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:
736 )
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1014 )
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443 )
    at org.apache.catalina.core.StandardService.start(StandardService.java:
448 )
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:
700 )
    at org.apache.catalina.startup.Catalina.start(Catalina.java:
552 )
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39 )
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25 )
    at java.lang.reflect.Method.invoke(Method.java:
597 )
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:
295 )
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:
433 )

 

 

你可能感兴趣的:(validation)