我似乎无法在流定义文件中定义任何全局转换。一旦我定义了全局转换,我就会遇到异常。
这是流程定义
MY-flow.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上的XML流定义文档 资源[/WEB-INF/flows/tempId-flow.xml] at 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) 在 org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.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(未知 来自org.apache.xerces.util.ErrorHandlerWrapper.error(未知 来源)at org.apache.xerces.impl.XMLErrorReporter.reportError(未知来源) 在org.apache.xerces.impl.XMLErrorReporter.reportError(未知 来源)at org.apache.xerces.impl.xs.XMLSchemaValidator $ XSIErrorReporter.reportError(未知 来源)at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(未知 来源)at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(未知 来源)at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(未知 来源)at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(未知 来源)at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl $ FragmentContentDispatcher.dispatch(未知 来源)at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(未知 来自org.apache.xerces.parsers.XML11Configuration.parse(未知 来自org.apache.xerces.parsers.XML11Configuration.parse(未知 来源)org.apache.xerces.parsers.XMLParser.parse(未知来源) 在org.apache.xerces.parsers.DOMParser.parse(未知来源)at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(未知来源)at javax.xml.parsers.DocumentBuilder.parse(未知来源)at 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更多
粗体字母的部分例外对我来说真的很混乱。为什么只有那些元素是预期的。我使用了参考教程中的最新流程定义模式
http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch03s05.html和http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch10s02.html
答案 0 :(得分:0)
没关系。我的元素序列错了。应该是所有的定义。