0

我似乎无法在流定义文件中定义任何全局转换。一旦我定义了全局转换,我就会遇到异常。

这是流定义

我的流.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <flow xmlns="http://www.springframework.org/schema/webflow" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="
              http://www.springframework.org/schema/webflow
              http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

<!-- set up appData initial values -->
     <on-start>
         <evaluate expression="SupportUtil.setUpInitialAppData(flowRequestContext)" result="flowScope.appData"/>    
     </on-start>

     <global-transitions>
        <transition on="login" to="login" />
        <transition on="logout" to="logout" />
      </global-transitions>

      <view-state id="searchHome" view="searchHome" model="searchModel">
            <transition on="grpSearch" to="performGrpSearch"/>
             <transition on="indSearch" to="performIndSearch"/>
       </view-state> 
  </flow>

启动应用程序后,出现以下错误,

org.springframework.webflow.engine.builder.FlowBuilderException:无法在 org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.doInit(FlowModelFlowBuilder.java:149) 的 org.springframework.webflow 获取此流的模型。 engine.builder.support.AbstractFlowBuilder.init(AbstractFlowBuilder.java:46) 在 org.springframework.webflow.engine.builder.FlowAssembler.assembleFlow(FlowAssembler.java:90) 在 org.springframework.webflow.engine.builder.DefaultFlowHolder。 assembleFlow(DefaultFlowHolder.java:109) ... 37 更多原因:org.springframework.webflow.engine.model.builder.FlowModelBuilderException:无法在 ServletContext 资源 [/WEB-INF/flows/tempId 解析 XML 流定义文档-flow.xml] 在 org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder。init(XmlFlowModelBuilder.java:121) 在 org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder.assembleFlowModel(DefaultFlowModelHolder.java:87) 在 org.springframework.webflow.engine.model.builder.DefaultFlowModelHolder.getFlowModel(DefaultFlowModelHolder. java:61) at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.doInit(FlowModelFlowBuilder.java:146) ... 40 更多原因:org.xml.sax.SAXParseException: cvc-complex-type.2.4 。一个:doInit(FlowModelFlowBuilder.java:146) ... 40 更多原因:org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:doInit(FlowModelFlowBuilder.java:146) ... 40 更多原因:org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:发现以元素“视图状态”开头的无效内容。'{"http://www.springframework.org/schema/webflow":on-end, "http://www.springframework.org/schema/webflow":output, "http://www.springframework" 之一.org/schema/webflow":exception-handler, "http://www.springframework.org/schema/webflow":bean-import}' 是预期的。在 org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org. org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) 的 apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ) 在 org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) 在 org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(未知来源)在 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher。dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse( Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source ) 在 javax.xml.parsers.DocumentBuilder.parse(Unknown Source) 在 org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) 在 org.springframework.webflow.engine.model .builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113) ... 43 更多XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser。 org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) 解析(Unknown Source) ) 在 org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113) 的 org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) ) ... 43 更多XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser。 org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) 解析(Unknown Source) ) 在 org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113) 的 org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) ) ... 43 更多xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces。 jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) at org .springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113) ... 43 更多xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces。 jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(Unknown Source) at org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) at org .springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder.init(XmlFlowModelBuilder.java:113) ... 43 更多org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) 的 parser.DocumentBuilder.parse(Unknown Source) org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder .init(XmlFlowModelBuilder.java:113) ... 43 更多org.springframework.webflow.engine.model.builder.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:113) 的 parser.DocumentBuilder.parse(Unknown Source) org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder .init(XmlFlowModelBuilder.java:113) ... 43 更多

粗体字中的部分异常让我很困惑。为什么只有这些元素是预期的。我使用了参考教程中的最新流定义模式

http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch03s05.htmlhttp://static.springsource.org/spring-webflow/docs/2.3.x/reference/ html/ch10s02.html

4

1 回答 1

0

没关系。我弄错了元素顺序。毕竟应该是定义。

于 2012-08-02T14:57:10.007 回答