Hi all,
I have this problem since I started using struts 2 and I still cannot find
the solution. Please help me. :)
Note : I didn't write all the codes.
I have a form.
<s:form>
<%-- order is a property in orderItem bean--%>
<s:set name="order" value="orderItem.order"/>
<s:label value="%{order.date}" label="order.date"/>
<s:hidden name="orderItem.order.id"/>
<s:textfield name="orderItem.quantity" key="orderItem.quantity"/>
<s:submit/>
</s:form>
Here orderItem.quantity is a required field. So when I left if blank and
press the submit button, the validation fails and displays the error message
in the screen. But this time label with id="orderDate" doesn't display the
order.date field on the screen because orderItem is no longer in the value
stack I guess. So it cannot get the order value of orderItem. It writes
nothing on the screen.
Here is the struts.xml
<action name="....." class="....." method="insert">
<result
name="input">/WEB-INF/pages/order/orderItem/orderItemModify.jsp</result>
</action>
When validation fails It returns to jsp. Because of not reaching an action I
cannot put order to the value stack back.
Any idea how can I get it worked? I hope I explained it well. If not please
post a message.
--
View this message in context:
http://www.nabble.com/When-validation-fails%2C-how-to-add-beans-back-to-the-value-stack-tf3772094.html#a10664756
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]