简体   繁体   English

接缝页面流示例NumberGuess无法登陆第二页

[英]Seam pageflow example NumberGuess Not landing on to the second page

I'm trying to run simple Seam PageFlow example NumberGuss. 我正在尝试运行简单的Seam PageFlow示例NumberGuss。 I have deployed it on Jboss Server. 我已经在Jboss服务器上部署了它。 When I access the URL it lands on the first page but if I hit any of the button provided on that page it says "The page isn't redirecting properly".On server log I found 当我访问URL时,它会到达第一页,但是如果我单击该页面上提供的任何按钮,则会显示“该页面未正确重定向”。在服务器日志上,我发现

SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-16) Error Rendering View[/debug.xhtml]: org.jboss.weld.context.NonexistentConversationException: WELD-000321: No conversation found to restore for id 1.

I'm using wildfly-8.1.0 and jboss-seam-2.3.1

Attaching pageflow.jpdl.xml and numberGuess.xhtml for reference. Please help me resolve the issue I'm facing.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:s="http://jboss.org/schema/seam/taglib"> <h:head> <title>Guess a number...</title> <link href="niceforms.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript" src="niceforms.js"><!-- --></script> </h:head> <body> <h1>Guess a number...</h1> <h:form id="NumberGuessMain" styleClass="niceform"> <div> <h:messages id="messages" globalOnly="true"/> <h:outputText id="Higher" value="Higher!" rendered="#{numberGuess.randomNumber gt numberGuess.currentGuess}"/> <h:outputText id="Lower" value="Lower!" rendered="#{numberGuess.randomNumber lt numberGuess.currentGuess}"/> </div> <div> I'm thinking of a number between <h:outputText id="Smallest" value="#{numberGuess.smallest}"/> and <h:outputText id="Biggest" value="#{numberGuess.biggest}"/>. You have <h:outputText id="RemainingGuesses" value="#{numberGuess.remainingGuesses}"/> guesses. </div> <div> Your guess: <h:inputText id="inputGuess" value="#{numberGuess.currentGuess}" required="true" size="3" rendered="#{(numberGuess.biggest-numberGuess.smallest) gt 20}"> <f:validateLongRange maximum="#{numberGuess.biggest}" minimum="#{numberGuess.smallest}"/> </h:inputText> <h:selectOneMenu id="selectGuessMenu" value="#{numberGuess.currentGuess}" required="true" rendered="#{numberGuess.selectMenuRendered}"> <s:selectItems id="PossibilitiesMenuItems" value="#{numberGuess.possibilities}" var="i" label="#{i}"/> </h:selectOneMenu> <h:selectOneRadio id="selectGuessRadio" value="#{numberGuess.currentGuess}" required="true" rendered="#{numberGuess.radioButtonRendered}"> <s:selectItems id="PossibilitiesRadioItems" value="#{numberGuess.possibilities}" var="i" label="#{i}"/> </h:selectOneRadio> <h:commandButton id="GuessButton" value="Guess" action="guess"/> <s:button id="CheatButton" value="Cheat" action="cheat"/> <s:button id="GiveUpButton" value="Give up" action="giveup"/> </div> <div> <h:message id="message" for="inputGuess" style="color: red"/> </div> </h:form> </body> </html> 
 <!-- An example of pageflow in jPDL. This exemplifies the approach where action handlers are attached transitions and decision nodes, instead of view components. An alternative approach would be to attach all action handlers to view components, and let the jPDL define only the navigation rules. --> <pageflow-definition xmlns="http://jboss.org/schema/seam/pageflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://jboss.org/schema/seam/pageflow http://jboss.org/schema/seam/pageflow-2.3.xsd" name="numberGuess"> <start-page name="displayGuess" view-id="/numberGuess.xhtml"> <redirect/> <transition name="guess" to="evaluateGuess"> <action expression="#{numberGuess.guess}"/> </transition> <transition name="giveup" to="giveup"/> <transition name="cheat" to="cheat"/> </start-page> <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}"> <transition name="true" to="win"/> <transition name="false" to="evaluateRemainingGuesses"/> </decision> <decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}"> <transition name="true" to="lose"/> <transition name="false" to="displayGuess"/> </decision> <page name="giveup" view-id="/giveup.xhtml"> <redirect/> <transition name="yes" to="lose"/> <transition name="no" to="displayGuess"/> </page> <process-state name="cheat"> <sub-process name="cheat"/> <transition to="displayGuess"/> </process-state> <page name="win" view-id="/win.xhtml"> <redirect/> <end-conversation/> </page> <page name="lose" view-id="/lose.xhtml"> <redirect/> <end-conversation/> </page> </pageflow-definition> 

Resolved the issue.Weld is scanning the archive, which seems to cause the problem.The Weld Docs says: You can either set this up for your deployment only by adding the following content to the META-INF/jboss-all.xml file of your application. 解决了该问题。Weld正在扫描档案文件,这似乎引起了问题。Weld Docs说:您只能通过将以下内容添加到META-INF / jboss-all.xml文件中来为部署进行设置你的申请。 jboss-all.xml file goes to your META-INF for ear archive and likely to WEB-INF for war archive jboss-all.xml文件进入您的META-INF进行耳朵存档,并可能转到WEB-INF进行战争存档

<jboss xmlns="urn:jboss:1.0">
<weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
</jboss> 

It worked for me. 它为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM