Announcement Announcement Module
Collapse
No announcement yet.
can't fill a jsp form with data in a spring web flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't fill a jsp form with data in a spring web flow

    hi,

    in spring web flow 2, i want to fill a jsp form's fields with data.

    this is my flow state having the jsp form

    Code:
    	<view-state id="register" view="content.create" model="contentFormBean">
    		<on-entry>
    			<evaluate expression="customAction" />
    		</on-entry>
    
    		<on-render>
    			<evaluate expression="contentUploadFileAction.test(contentFormBean)" />
    		</on-render>
    
    		<transition on="next" to="eventProps" />
    		<transition on="cancel" to="done" validate="false" />
    	</view-state>
    in customAction exeecute method, i set contentFormBean attributes with the values, i want to show in the form, then i put contentFormBean in the flow scope like this

    Code:
    ContentFormBean contentFormBean = new ContentFormBean();
            contentFormBean.setPhisicalName("phisicalNameTest");
            contentFormBean.setCheckIn(true);
            
            context.getFlowScope().put("contentFormBean", contentFormBean);
    in the contentUploadFileAction.test(contentFormBean) method, which executed before the rendering of the jsp, i have contentFormBean attributes with the values i have set in customAction exeecute and everything is ok

    when the jsp renders...all fields are empty
    and this my jsp

    Code:
    <form:form
    	name="createContentForm" method="POST" modelAttribute="contentformBean">
    <table align='center' width="600px"
    		dir="<spring:message code="label.dir"/>">
    <tr class="form-item">
    			<td class="form-label"><spring:message code="label.phisicalName" />:</td>
    			<td><form:input path="phisicalName" size="40" /></td>
    			<td><form:errors path="phisicalName"></form:errors></td>
    		</tr>
    
    	<tr class="form-item">
    			<td class="form-label"><spring:message code="label.checkIn" /> :</td>
    			<td><form:checkbox path="checkIn" /></td>
    			<td><form:errors path="checkIn"></form:errors></td>
    		</tr>
    
    </table>
    </form:form>
    thnx in advance

  • #2
    i am so sorry...the problem has solved...it was all about the bean name in the flowscope and the jsp form modelAttribute

    Comment

    Working...
    X