Announcement Announcement Module
Collapse
No announcement yet.
How do I pass a new model to a view-state in Spring WebFlow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I pass a new model to a view-state in Spring WebFlow

    How do I pass a new model to a view-state in Spring WebFlow2. I have a input screen where my user enters some data and then it goes back to the server to process it. If the data is ok then I have to setup a Ticket Model and pass it to the next view-state to display.

    I can't get the next view-state to display the data in the Ticket. Can someone please help me out.

    My Flow:

    Code:
     <view-state id="MemberInquiry" view="question.jsp" model="memberrequest" >
            	<transition on="submit" to="endState">
            		<evaluate expression="flowActions.addInquiry(memberrequest)" result="flowScope.ticket"/>
        		</transition>
        	 		
            	<transition on="cancel" to="endState" bind="false"/>
        	</view-state>
        	
        	<view-state id="endState" view="thanks.jsp" >
            	
        	</view-state>
    Here is the code in the controller:

    Code:
     public Ticket addInquiry(MemberRequest memberrequest) {
        
        		LOGGER.debug("[" + memberrequest.toString() + "]");
        
        		// Setting data over to RT
        
        		String Ticket = memberInquiryService.sentWebRequest(memberrequest);
        
        		/*
        		 * Setting out the ticket number to be displayed to user
        		 */
        
        		Map<String, Object> model = new HashMap<String, Object>();
        		Ticket t = new Ticket();
        		t.setTicketDetails(Ticket);
        		
        		LOGGER.debug("[" + t.toString() + "]");
        
        		return t;
        	}
    Here is the code in the thanks page:

    Code:
    <p>
        	Thanks for submitting.  We will get back to you as soon as possible.
        	<p>
        	<c:out value="${ticket.TicketDetails}" />
        	<br>
        	</div>
Working...
X