More Related Content Similar to We9 Struts 2.0 (20) We9 Struts 2.022. Struts 1 < html:errors /> < html:form action = "/SaveMeeting" > < table border = "0" width = "100%" > < tr > < th align = "right" > Name: </ th > < td align = "left" > < html:text property = "name" size = ”50” /> </ td > </ tr > < tr > < th align = "right" > Date: 23. </ th > < td align = "left" > < html:text property = "date" size = "50" /> </ td > </ tr > < tr > < th align = "right" > Invitees: </ th > < td align = "left" > < html:select property = "invitees" multiple = "true" > < html:options collection = "employees" property = "value" labelProperty = "label" /> </ html:select > 24. </ tr > < tr > < th align = "right" > Description: </ th > < td align = "left" > < html:textarea property = "description" rows = "4" cols = "50" /> </ td > </ tr > < tr > < td align = "right" > </ td > 25. ... Only four pages! < td align = "left" > < html:submit property = "DO_SUBMIT" > Save </ html:submit > </ td > </ tr > </ table > </ html:form > 26. Struts 2 < s:form action = "Meeting" validate = "true" > < s:token /> < s:textfield label = ”Name” name = “name” /> < s:textfield label = ”Date" name = "date" /> < s:select label = ”Invitees” name = "invitees" list = "employees" /> < s:textarea label = ”Description” n ame = "description" rows = "4" cols = "50" /> < s:submit value = ”Save" method = "save" /> </ s:form > 31. < jsp:include page = "/ajax/commonInclude.jsp" /> ... <s:textarea theme = "ajax" label="Description" name="description" rows="4" cols="50" /> 33. Brian Kernighan Law of Debugging Difficulty Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. 38. Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); } } 44. < action name = "editGangster" class = "org.apache.struts2.s1.Struts1Action" > < param name = "className" > com.mycompany.gangstas.EditGangsterAction </ param > < result > gangsterForm.jsp </ result > </ action > Run Struts 1 Actions as Is