【发布时间】:2014-05-09 08:25:46
【问题描述】:
我有 cardQuestion.jspx
<html xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:form="http://www.springframework.org/tags/form" contenteditable="inherit">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<head>
<title>SS</title>
</head>
<body>
<label>${wordingPractice.question}</label>
</body>
</html>
我有流声明 wording-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">
<var name="wordingPractice" class="Practice.WordingPractice"/>
<view-state id="wording">
<transition on="next" to="setTranslationDirection"/>
<transition on="cancel" to="endState"/>
</view-state>
<action-state id="setTranslationDirection">
<evaluate expression="wordingPractice.translationDirection = requestParameters.translationDirection"/>
<transition to="setSaver"/>
</action-state>
<action-state id="setSaver">
<evaluate expression="wordingPractice.saver = saverExtension"/>
<transition to="nextCard"/>
</action-state>
<action-state id="nextCard">
<evaluate expression="wordingPractice.nextCard()"/>
<transition to="cardQuestion"/>
</action-state>
<view-state id="cardQuestion">
<transition on="cancel" to="endState"/>
</view-state>
<end-state id="endState" />
</flow>
在方法 nextCard - 我初始化问题变量。 但是当我在 jspx 中调用它时:${wordingPractice.question} 它让我得到空指针异常。 另外,当我调试时,我看到当我调用 nextCard - 这是 ObjectID1 , 但是当我调用 getQuestion - 这是 ObjectID2。
jspx中如何访问流变量?
【问题讨论】:
标签: spring spring-webflow jspx