martinc 02/02/20 21:48:10 Modified: web/exercise-taglib html-select.jsp Log: Fixed a problem introduced by calling ActionForm.reset() when the FormTag instantiates the associated form bean. The initial values for the tests were not showing up. Revision Changes Path 1.5 +13 -0 jakarta-struts/web/exercise-taglib/html-select.jsp Index: html-select.jsp =================================================================== RCS file: /home/cvs/jakarta-struts/web/exercise-taglib/html-select.jsp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- html-select.jsp 13 Jan 2002 00:25:37 -0000 1.4 +++ html-select.jsp 21 Feb 2002 05:48:10 -0000 1.5 @@ -35,6 +35,19 @@ is redisplayed. Press "Save" to update, or "Cancel" to return to the main menu. +<%-- + Ensure that the form bean exists before the form tag is processed. This + is a simple (if not entirely clean) way of ensuring that the initial + values assigned during bean instantiation will be available within the + form, since reset() will not be called when the form bean already exists. + + The right way to fix this is to modify this webapp so that it does not + refer directly to JSP pages, but goes through Action classes, and to + either modify the TestBean class, adding an initialize() method, or to + have an Action class set the initial values. +--%> +<jsp:useBean id="testbean" scope="session" class="org.apache.struts.webapp.exercise.TestBean"/> + <html:form action="html-select.do"> <table border="0" width="100%">
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>