At line 6 changed 1 line. |
This tutorial will show you how to create an Action, a JUnit Test (using [StrutsTestCase|http://strutstestcase.sourceforge.net/]), and a JSP for the form. The Action we create will talk to the PersonManager we created in the [Creating Managers|CreateManager] tutorial. This tutorial will simplify everything - we will not actually be rendering any data or making the UI look pretty. The [next tutorial|ConfiguringTiles] will show you how to integrate your new JSP into your webapp. |
This tutorial will show you how to create a Struts Action, a JUnit Test (using [StrutsTestCase|http://strutstestcase.sourceforge.net/]), and a JSP for the form. The Action we create will talk to the PersonManager we created in the [Creating Managers|CreateManager] tutorial. This tutorial will simplify everything - we will not actually be rendering any data or making the UI look pretty. The [next tutorial|ConfiguringTiles] will show you how to integrate your new JSP into your webapp. |
At line 17 changed 1 line. |
Let's get started by creating a new Action and JSP in AppFuse's architecture. |
Let's get started by creating a new Struts Action and JSP your AppFuse project. |
At line 67 changed 1 line. |
All this is to say that __putting the personForm.jsp in the ''web'' folder will allow us to view it without making a Tile for it__. ''We'll get to that in the next tutorial.'' |
All this is to say that __putting the personForm.jsp in the ''web'' folder will allow us to view it without creating an Action to get to it__. |
At line 69 changed 1 line. |
At this point, you won't be able to view the JSP in your browser because the <html:form> tag in personForm.jsp has ''action="editPerson"'' - and this action-mapping doesn't exist (yet) in struts-config.xml. You can try it yourself (cd ../.. first) by setting up AppFuse on Tomcat using __ant setup-db setup-tomcat deploy__. |
At this point, you won't be able to view the JSP in your browser because the <html:form> tag in personForm.jsp has ''action="editPerson"'' - and this action-mapping doesn't exist (yet) in struts-config.xml. You can try it yourself (cd ../.. first) by setting up AppFuse on Tomcat using __ant setup__. |
At line 80 changed 1 line. |
;:%%(color: blue)''As usual, copy → save as an existing ActionTest (i.e. UserActionTest). Replace [[Uu]ser with [[P]erson. You might want to make sure [Cactus|http://jakarta.apache.org/cactus] (StrutsTestCase is an extension of Cactus] tests are running before you copy an existing one. Run __ant test-cactus -Dtestcase=UserAction__ to verify the UserAction works. Stop Tomcat before you do this.''%% |
;:%%(color: blue)''As usual, copy → save as an existing ActionTest (i.e. UserActionTest). Replace [[Uu]ser with [[P]erson. You might want to make sure [Cactus|http://jakarta.apache.org/cactus] (StrutsTestCase is an extension of Cactus] tests are running before you copy an existing one. Run __ant test-cactus -Dtestcase=UserAction__ to verify the UserAction works. Stop Tomcat before you do this. |
At line 82 changed 1 line. |
If you did copy UserActionTest, make sure and change ''UserFormEx'' to ''PersonForm''. The reason for ''UserFormEx'' is to support indexed properties and non-struts validation. Since the UserForm is generated, it's not very feasible to do it in the User.java object. |
If you did copy UserActionTest, make sure and change ''UserFormEx'' to ''PersonForm''. The reason for ''UserFormEx'' is to support a String[] setter for Roles. Since the UserForm is generated, it's not very feasible to do it in the User.java object.''%% |
At line 131 removed 1 line. |
private static Log log = LogFactory.getLog(PersonAction.class); |
At line 180 changed 1 line. |
''Next Up:'' __Part IV:__ [Configuring Tiles and Action CRUD methods|ConfiguringTiles] - Integrating personForm.jsp with Tiles, replacing execute with different CRUD methods (add, edit, delete), customizing the JSP so it looks good and finally - writing a WebTest to test the JSPs functionality. |
''Next Up:'' __Part IV:__ [Configuring JSP and Action CRUD methods|ConfiguringTiles] - Integrating personForm.jsp with Struts, replacing execute with different CRUD methods (add, edit, delete), customizing the JSP so it looks good and finally - writing a WebTest to test the JSPs functionality. |