Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_cn
Articles_pt
Articles_zh
SpringControllers
ValidationAndListSpr...




JSPWiki v2.2.33

[RSS]


Hide Menu

ValidationAndListSpring


Difference between version 32 and version 1:

At line 1 changed 1 line.
__Part V:__ [Adding Validation and List Screen|ValidationAndList] - Adding validation logic to the personForm so that firstName and lastName are required fields and adding a list screen to display all person records in the database.
__Part IV:__ [Adding Validation and List Screen|ValidationAndListSpring] - Adding validation logic to the Person object so that firstName and lastName are required fields and adding a list screen to display all person records in the database.
At line 3 changed 1 line.
;:''This tutorial depends on __Part IV:__ [Configuring Tiles and Action CRUD methods|ConfiguringTiles].''
;:''This tutorial depends on __Part III:__ [Creating Controllers and JSPs|SpringControllers].''
At line 6 changed 1 line.
This tutorial will show you how to add Validation logic (client and server-side) to the personForm object using Struts' Validator. We'll also create a list screen using the [Display Tag Library|http://displaytag.sf.net] to display all the people in the database.
This tutorial will show you how to add Validation logic (client and server-side) to the Person object using Commons Validator. We'll also create a list screen using the [Display Tag Library|http://displaytag.sf.net] to display all the people in the database.
At line 11 changed 1 line.
* [1] Add XDoclet Validator to Person.java
* [1] Add XDoclet Validator tags to Person.java
At line 14 changed 2 lines.
* [5] Add ''testSearch'' methods to Action Test
* [6] Add ''search '' method to Action
* [4] Add ''getPeople'' methods to PersonDao and Manager
* [5] Create PersonControllerTest
* [6] Create PersonController
At line 20 changed 1 line.
To use Commons Validator with Struts (or Spring MVC), normally you have to write a validation.xml file by hand. If you're not using AppFuse, you also have to configure the Validator Plugin and error keys in your ApplicationResources_en.properties. For more information on this, see the [Validation Made Easy Tutorial|http://www.reumann.net/do/struts/lesson3/step8].
To use Commons Validator with Spring MVC, normally you have to write a validation.xml file by hand. However, thanks to XDoclet, it's much easier - you just need to add a couple of ''@spring.validator'' tags to our POJO (Person.java). Let's open it up (src/dao/**/dao/Person.java) and modify your setFirstName and setLastName methods to resemble the following:
At line 22 removed 2 lines.
Using XDoclet, it's much easier - we just need to add a couple of ''@struts.validator'' (or ''@spring.validator'') tags to our POJO (Person.java). Let's open it up (src/dao/**/persistence/Person.java) and modify your setFirstName and setLastName methods to resemble the following:
At line 27 changed 3 lines.
* @return Returns the firstName.
* @struts.validator type="required"
* @hibernate.property column="first_name" length="50"
* @spring.validator type="required"
At line 31 changed 2 lines.
public String getFirstName() {
return this.firstName;
public void setFirstName(String firstName) {
this.firstName = firstName;
At line 36 changed 3 lines.
* @return Returns the lastName.
* @struts.validator type="required"
* @hibernate.property column="last_name" length="50"
* @spring.validator type="required"
At line 40 changed 2 lines.
public String getLastName() {
return this.lastName;
public void setLastName(String lastName) {
this.lastName = lastName;
At line 45 removed 2 lines.
%%(color: green)__Spring MVC:__ If you're using Spring for your MVC layer - use @spring.validator tags and put them on the ''setter'' methods, rather than the getters.%%
At line 51 changed 1 line.
@struts.validator type="required" msgkey="errors.required"
@spring.validator type="required" msgkey="errors.required"
At line 54 changed 1 line.
The default key for type="required" is already ''errors.required'', so I usually leave it to the default. This key is defined in web/WEB-INF/classes/ApplicationResources_*.properties. You'll notice that we put these tags on the ''getters'' of this class even though the [XDoclet documentation|http://xdoclet.sourceforge.net/tags/apache-tags.html#@struts.validator%20(0..*)] says to put them on the setters. This is because we are generating our PersonForm.java - the template file (metadata/template/struts_form.xdt) takes care of putting these tags onto the setters in the generated file.
The default key for type="required" is already ''errors.required'', so I usually leave it to the default. This key is defined in web/WEB-INF/classes/ApplicationResources_*.properties.
At line 56 changed 1 line.
Now if you save Person.java and run __ant webdoclet__, a validation.xml file will be generated in build/appfuse/WEB-INF/. It's contents should have now have an entry for "personForm". <span style="color: green">For the Spring MVC version, "personForm" will be "person".
Now if you save Person.java and run __ant clean webdoclet__, a validation.xml file will be generated in build/appfuse/WEB-INF/. It's contents should have now have an entry for "person".
At line 60 changed 1 line.
<form name="personForm">
<form name="person">
At line 64 changed 1 line.
<arg0 key="personForm.firstName"/>
<arg0 key="person.firstName"/>
At line 69 changed 1 line.
<arg0 key="personForm.lastName"/>
<arg0 key="person.lastName"/>
At line 74 changed 1 line.
To enable validation in our personForm.jsp, you'll need to make sure your personForm.jsp has the following at the bottom:
To enable validation in personForm.jsp, you'll need to make sure your personForm.jsp has the following at the bottom:
At line 76 changed 1 line.
{{{<html:javascript formName="personForm" cdata="false"
{{{<v:javascript formName="person" cdata="false"
At line 79 changed 1 line.
src="<html:rewrite page="/scripts/validator.jsp"/>"></script>}}}
src="<c:url value="/scripts/validator.jsp"/>"></script>}}}
At line 81 changed 1 line.
%%(color: green) For the Spring MVC version, change formName="personForm" to __formName="person"__.%%
You'd also need to uncomment the "validator" property we commented out earlier. Make sure the "personFormController" &lt;bean&gt; in web/WEB-INF/action-servlet.xml has the following XML:
At line 83 removed 4 lines.
!!View JSP with validation added and test [#2]
Now that we have Validation configured for this form, whenever this form is used in an action-mapping with validate="true", these rules will be applied. In the [last tutorial|ConfiguringTiles], we added the "savePerson" action-mapping for PersonAction. The XDoclet tags for this action-mapping were:
At line 89 changed 2 lines.
* @struts.action name="personForm" path="/savePerson" scope="request"
* validate="true" parameter="action" input="edit"
<bean id="personFormController" class="org.appfuse.webapp.action.PersonFormController">
<property name="commandName"><value>person</value></property>
<property name="commandClass"><value>org.appfuse.model.Person</value></property>
<property name="validator"><ref bean="beanValidator"/></property>
<property name="formView"><value>personForm</value></property>
<property name="successView"><value>mainMenu.html</value></property>
<property name="personManager"><ref bean="personManager"/></property>
</bean>
At line 93 changed 1 line.
So now, as long as your web/pages/personForm.jsp has &lt;html:form action="savePerson"&gt;, validation should kick in when we try to save this form. Run __ant db-load deploy__, start Tomcat and go to [http://localhost:8080/appfuse/editPerson.do?id=1].
!!View JSP with validation added and test [#2]
At line 90 added 2 lines.
Now that we have Validation configured for this form, let's make sure it works. Run __ant db-load deploy__, start Tomcat and go to [http://localhost:8080/appfuse/editPerson.html?id=1]. One thing you might notice is that the "First Name" and "Last Name" labels now have asterisks next to them - indicating required fields. This is achieved with a LabelTag that looks up the validation rules from Commons Validator.
At line 98 changed 1 line.
[validation-required.png]
[ValidationAndList/validation-required.png]
At line 103 changed 2 lines.
%%(border: 1px solid black; margin: 0 auto; height: 202px; width: 423px)
[validation-required-nojs.png]
%%(border: 1px solid black; margin: 0 auto; height: 215px; width: 521px)
[ValidationAndList/validation-required-nojs.png]
At line 107 removed 1 line.
If you don't see these validation errors, there are a couple possibilities:
At line 109 removed 5 lines.
* The form saves with a success message, but the firstName and lastName fields are now blank.
;:''This is because the &lt;html:form&gt; in web/pages/personForm.jsp has action="editPerson" - make sure it has __action="savePerson"__.''
* You click save, but a blank page appears.
;:''The blank page indicates that the "input" attribute of you "savePerson" forward is incorrectly configured. Make sure it relates to a local or global action-forward. In this example, it should be __input="edit"__, which points to the .personDetail tile's definition. From my experience, the input's value must be a forward, not a path to an action.''
At line 118 changed 1 line.
<html:javascript formName="personForm" cdata="false"
<v:javascript formName="personForm" cdata="false"
At line 127 changed 1 line.
Open test/dao/**/persistence/PersonDaoTest.java and add a ''testGetPeople'' method:
Open test/dao/**/dao/PersonDaoTest.java and add a ''testGetPeople'' method:
At line 132 changed 1 line.
person = new Person();
person = new Person();
At line 138 changed 1 line.
The reason I'm passing in a person object to the ''getPeople'' method is to allow for filtering (based on values in person) in the future.
The reason I'm passing in a person object to the ''getPeople'' method is to allow for filtering (based on values in person) in the future. Adding this parameter in your getPeople() method signature is optional, but the rest of this tutorial assumes you have done this.
At line 144 changed 3 lines.
public void testGetPeople() {
List results = mgr.getPeople(new Person());
assertTrue(results.size() > 0);
public void testGetPeople() throws Exception {
List results = new ArrayList();
person = new Person();
results.add(person);
// set expected behavior on dao
personDao.expects(once()).method("getPeople")
.will(returnValue(results));
List people = personManager.getPeople(null);
assertTrue(people.size() == 1);
personDao.verify();
At line 150 changed 1 line.
Save all your files and make sure everything compiles with __ant clean compile__. Now you should be able to run both tests by running the following:
In order for these tests to compile, you need to add the ''getPeople()'' method to the PersonDao and PersonManager interfaces, and their implementations.
At line 152 changed 2 lines.
* __ant test-dao -Dtestcase=PersonDao__
* __ant test-service -Dtestcase=PersonManager__
!!Add getPeople() method to DAO and Manager [#4]
Open src/dao/**/dao/PersonDao.java and add the getPeople() method signature:
At line 155 changed 1 line.
If everything works - ''nice job!'' Now we need to add this ''retrieve all'' functionality to the web tier.
[{Java2HtmlPlugin
At line 157 changed 2 lines.
!!Add testSearch method to Action Test [#5]
Open test/web/**/action/PersonActionTest.java and add the following method:
public List getPeople(Person person);
}]
At line 160 changed 1 line.
;:%%(color: blue)''I copied the testSearch method from UserActionTest.java and changed the "User" stuff to "Person".''
Now add the same method signature to src/service/**/service/__PersonManager.java__. Save all your files and adjust the imports in your tests. Next you need to implement the getPeople() method in your implementation classes. Open src/dao/**/dao/hibernate/PersonDaoHibernate.java and add the following method:
At line 164 changed 9 lines.
public void testSearch() {
setRequestPathInfo("/editPerson");
addRequestParameter("action", "Search");
actionPerform();
verifyForward("list");
assertTrue(getRequest().getAttribute(Constants.PERSON_LIST) != null);
verifyNoActionErrors();
public List getPeople(Person person) {
return getHibernateTemplate().find("from Person");
At line 176 changed 1 line.
This class will not compile until you add the PERSON_LIST variable to the src/dao/**/Constants.java file.
<div class="note" style="margin-left: 30px">
You'll notice here that nothing is being done with the ''person'' parameter. This is just a placeholder for now - in the future you may want to filter on it's properties using [Hibernate's Query Language|http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html] (HQL) or using [Criteria Queries|http://www.hibernate.org/hib_docs/reference/en/html/querycriteria.html].
At line 178 changed 1 line.
;:%%(color: blue)''I usually copy a similar variable that already exists in this file - i.e. USER_LIST.''
''An example using a Criteria Query:''
At line 182 changed 4 lines.
/**
* The request scope attribute that holds the person list
*/
public static final String PERSON_LIST = "personList";
Example example = Example.create(person)
.excludeZeroes() // exclude zero valued properties
.ignoreCase(); // perform case insensitive string comparisons
try {
return getSession().createCriteria(Person.class)
.add(example)
.list();
} catch (Exception e) {
throw new DataAccessException(e.getMessage());
}
return new ArrayList();
At line 189 added 1 line.
</div>
At line 188 changed 1 line.
Now save all your changes. You won't be able to run __ant test-cactus -Dtestcase=PersonAction__ yet since ''PersonAction.search()'' does not exist (yet). Let's add it.
Now implement the ''getPeople()'' method in src/service/**/impl/PersonManagerImpl.java:
At line 190 removed 3 lines.
!!Add search method to Action [#6]
Open src/web/**/action/PersonAction.java and add the following XDoclet tag at the top - to forward to our list screen.
At line 195 changed 1 line.
* @struts.action-forward name="list" path=".personList"
public List getPeople(Person person) {
return dao.getPeople(person);
}
At line 198 changed 1 line.
Now add the search method to the body of the PersonAction class.
After saving all your changes, you should be able to run both tests by executing the following:
At line 200 changed 1 line.
;:%%(color: blue)''I used UserAction.search() as a template for this method.''
* __ant test-dao -Dtestcase=PersonDao__
* __ant test-service -Dtestcase=PersonManager__
At line 205 added 9 lines.
If everything works - ''nice job!'' Now you need to add this ''retrieve all'' functionality to the web tier.
!!Create PersonControllerTest [#5]
In the last couple of tutorials, we've been working with the PersonFormController to interact with our HTML form. Now we need to create a new Controller that'll simply handle getting and displaying a list of people in the database.
;:''You could also use a [MultiActionController|http://www.springframework.org/docs/api/org/springframework/web/servlet/mvc/multiaction/MultiActionController.html] to handle all your List screens.''
To begin, create test/web/**/action/PersonControllerTest.java (extends BaseControllerTestCase) and add the following method:
At line 204 changed 7 lines.
public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'search' method");
}
package org.appfuse.webapp.action;
At line 212 changed 4 lines.
// Exceptions are caught by ActionExceptionHandler
PersonManager mgr = (PersonManager) getBean("personManager");
List people = mgr.getPeople(null);
request.setAttribute(Constants.PERSON_LIST, people);
import java.util.Map;
At line 217 changed 2 lines.
// return a forward to the person list definition
return mapping.findForward("list");
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.appfuse.Constants;
import org.springframework.web.servlet.ModelAndView;
public class PersonControllerTest extends BaseControllerTestCase {
public void testHandleRequest() throws Exception {
PersonController c = (PersonController) ctx.getBean("personController");
ModelAndView mav = c.handleRequest((HttpServletRequest) null,
(HttpServletResponse) null);
Map m = mav.getModel();
assertNotNull(m.get(Constants.PERSON_LIST));
assertEquals(mav.getViewName(), "personList");
At line 236 added 1 line.
}
At line 222 changed 1 line.
Now if you run __ant test-cactus -Dtestcase=PersonAction__, you will get an error that the .personList definition does not exist. Or, at least that is what the following error is trying to say:
This class will not compile until you (1) create the PersonController class and (2) add the PERSON_LIST variable to the src/dao/**/Constants.java file. Some folks have suggested that this class be named ''PersonControllerList'' - the name choice is up to you. I prefer Controller and FormController because it tells me one implements [Controller|http://www.springframework.org/docs/api/org/springframework/web/servlet/mvc/Controller.html] while the latter extends [SimpleFormController|http://www.springframework.org/docs/api/org/springframework/web/servlet/mvc/SimpleFormController.html].
At line 224 changed 4 lines.
{{{
Testcase: testSearch(org.appfuse.webapp.action.PersonActionTest): FAILED
was expecting '/appfuse/.personList' but received '/appfuse.personList'
}}}
;:%%(color: blue)''I usually copy a similar variable that already exists in this file - i.e. USER_LIST.''
At line 229 changed 2 lines.
!!Create personList.jsp and Canoo test [#7]
Let's create the JSP to hold our list and a Tile's definition for it. There should already be a personList.jsp in the ''web'' folder of your project. Copy this file to web/pages/personList.jsp. If it's not there, you can use the ViewGen Tool to create it. To do this from the command-line, navigate to extras/viewgen and run __ant -Dform.name=PersonForm__. This will generate a PersonFormList.jsp in extras/viewgen/build.
[{Java2HtmlPlugin
At line 232 changed 1 line.
Once personList.jsp exists in ''web/pages'', open it for editing.
/**
* The request scope attribute that holds the person list
*/
public static final String PERSON_LIST = "personList";
}]
At line 234 changed 1 line.
At the top of the file is a &lt;bean:struts&gt; tags that exposes the edit screen's forward as a page-scoped variable. This should already have a value of "editPerson".
Now save all your changes. You won't be able to run __ant test-web -Dtestcase=PersonController__ yet since ''PersonController'' does not exist (yet). Let's add it.
At line 253 added 3 lines.
!!Create PersonController [#6]
Create src/web/**/action/PersonController.java. It should implement {{org.springframework.web.servlet.mvc.Controller}} and read as follows:
At line 238 changed 3 lines.
<%-- For linking to edit screen --%>
<bean:struts id="editURL" forward="editPerson"/>
}]
package org.appfuse.webapp.action;
At line 242 changed 1 line.
Now we need to add this to the metadata/web/global-forwards.xml, as well as one for viewing the list. This way, they will get included in our struts-config.xml file.
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
At line 244 changed 1 line.
[{Java2HtmlPlugin
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
At line 246 changed 2 lines.
<forward name="editPerson" path="/editPerson.html"/>
<forward name="viewPeople" path="/editPerson.html?action=Search"/>
import org.appfuse.Constants;
import org.appfuse.model.Person;
import org.appfuse.service.PersonManager;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class PersonController implements Controller {
private final Log log = LogFactory.getLog(PersonController.class);
private PersonManager mgr = null;
public void setPersonManager(PersonManager personManager) {
this.mgr = personManager;
}
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'handleRequest' method...");
}
return new ModelAndView("personList", Constants.PERSON_LIST,
mgr.getPeople(new Person()));
}
}
At line 250 changed 1 line.
In the first &lt;button&gt; you find in personList.jsp, we need to populate another forward - this time to the Add screen. Make sure your button's onclick event matches the following:
Now add a definition to web/WEB-INF/action-servlet.xml for this Controller.
At line 254 changed 1 line.
onclick="location.href='<html:rewrite forward="editPerson"/>'">
<bean id="personController" class="org.appfuse.webapp.action.PersonController">
<property name="personManager"><ref bean="personManager"/></property>
</bean>
At line 257 changed 1 line.
The template we used to create this JSP has the column for the id property hard-coded, so XDoclet adds it twice. We need to remove this from personList.jsp - so delete the following from this file:
Now if you run __ant test-web -Dtestcase=PersonController__, the test should pass. Next, create a URL mapping for this controller. To do this, search for the "urlMapping" bean in web/WEB-INF/action-servlet.xml and add the following line to the "mappings" property:
At line 261 changed 2 lines.
<display:column property="id" sort="true" headerClass="sortable"
titleKey="personForm.id"/>
<prop key="/people.html">personController</prop>
At line 265 changed 1 line.
;:''If anyone knows of a way to modify the extras/viewgen/src/List_jsp.xdt to not include this column tag, please let me know.''
!!Create personList.jsp and Canoo test [#7]
Open the personList.jsp file in the ''web/pages'' folder of your project. One thing you'll probably want to change is the plural form of the items you're listing. The generated name in this example is "persons" and it should probably be people. At or near line 31, you should have the following line:
At line 267 removed 2 lines.
Another thing you'll probably want to change is the plural form of the items you're listing. The generated name in this example is "persons" and it should probably be people. At or near line 31, you should have the following line:
At line 275 changed 1 line.
Now we need to add a new definition to tiles-config.xml for this list screen. Open web/WEB-INF/tiles-config.xml and add the following XML:
Finally, add the title and heading keys (personList.title and personList.heading) to web/WEB-INF/classes/ApplicationResources.properties. Open this file and add the following:
At line 277 removed 14 lines.
;:%%(color: blue)''I usually copy an existing list definition - i.e. .userList.''
[{Java2HtmlPlugin
<!-- Person List definition -->
<definition name=".personList" extends=".mainMenu">
<put name="titleKey" value="personList.title" />
<put name="headingKey" value="personList.heading" />
<put name="content" value="/WEB-INF/pages/personList.jsp"/>
</definition>
}]
Finally, we need to add these keys (personList.title and personList.heading) to web/WEB-INF/classes/ApplicationResources_en.properties. Open this file and add the following:
At line 297 changed 2 lines.
As a reminder, the {{personList.title}} is what ends up in the brower's title bar (the &lt;title&gt; tag) and
{{personList.heading}} will be put into an &lth1&gt; tag before any page content. At this point, your PersonActionTest should succeed. Save all your changes, navigate to the basedir of your project and try it by executing __ant test-cactus -Dtestcase=PersonAction__.
As a reminder, the {{personList.title}} is what ends up in the browser's title bar (the &lt;title&gt; tag) and
{{personList.heading}} will be put into an &lth1&gt; tag before any page content. At this point, you could be able to run "ant deploy", start Tomcat and [open the list screen in your browser|http://localhost:8080/appfuse/people.html].
At line 300 changed 5 lines.
%%(color:green)
''__Sweet!__''\\
BUILD SUCCESSFUL\\
Total time: 1 minute 0 seconds
%%
Now that we have a List Screen, let's change the pages that are displayed after adding and deleting a new Person. In web/WEB-INF/action-servlet.xml, change the personFormController's successView property to be "people.html".
At line 306 removed 4 lines.
At this point, you should be able to view this page in your browser at [http://localhost:8080/appfuse/editPerson.do?action=Search].
Now that we have a List Screen, let's change the pages that are displayed after adding and deleting a new Person. In src/web/**/PersonAction.java, change the ''mapping.findForward("mainMenu")'' in the ''save'', ''delete'' and ''cancel'' methods to be:
At line 312 changed 1 line.
return mapping.findForward("viewPeople");
<property name="successView"><value>people.html</value></property>
At line 315 changed 1 line.
You will also need to change ''verifyForward("list")'' to be ''verifyForward("viewPeople")'' in the testRemove method of test/web/**/PersonActionTest.java. Lastly, the Canoo tests "AddPerson" and "DeletePerson" need to be updated. Open test/web/web-tests.xml and change the following line in the "AddPerson" target:
You will also need to update the Canoo tests "AddPerson" and "DeletePerson". Open test/web/web-tests.xml and change the following line in the "AddPerson" target:
At line 327 changed 2 lines.
{{{<verifytitle description="display Main Menu"
text=".*$(mainMenu.title}.*" regex="true"/>
{{{<verifytitle description="display Main Menu" text=".*$(mainMenu.title}.*" regex="true"/>
At line 333 changed 2 lines.
{{{<verifytitle description="display Person List"
text=".*$(personList.title}.*" regex="true"/>}}}
{{{<verifytitle description="display Person List" text=".*${personList.title}.*" regex="true"/>}}}
At line 336 changed 1 line.
We use "viewPeople" instead of "list" so that the search method will be executed, rather than simply forwarding to the .personList definition (which the "list" forward points to).
To test that displaying this page works, you can create a new JSP test in test/web/web-tests.xml:
At line 338 removed 2 lines.
To test that displaying this page works, we can create a new JSP test in test/web/web-tests.xml:
At line 349 changed 1 line.
<invoke description="click View People link" url="/editPerson.html?action=Search"/>
<invoke description="click View People link" url="/people.html"/>
At line 381 added 1 line.
At line 370 changed 1 line.
Now you can run __ant test-canoo -Dtestcase=SearchPeople__ (or ''ant test-jsp'' if Tomcat isn't running) and hopefully it will result in "BUILD SUCCESSFUL". If so - ''nice work!''
Now you can run __ant deploy test-canoo -Dtestcase=SearchPeople__ (or ''ant test-jsp'' if Tomcat isn't running) and hopefully it will result in "BUILD SUCCESSFUL". If so - ''nice work!''
At line 378 changed 3 lines.
<html:link forward="viewPeople">
<fmt:message key="menu.viewPeople"/>
</html:link>
<a href="<c:url value="/people.html"/>"><fmt:message key="menu.viewPeople"/></a>
At line 384 changed 1 line.
Where ''menu.viewPeople'' is an entry in web/WEB-INF/classes/ApplicationResources_en.properties.
Where ''menu.viewPeople'' is an entry in web/WEB-INF/classes/ApplicationResources.properties.
At line 393 changed 1 line.
<Menu name="PeopleMenu" title="menu.viewPeople" forward="viewPeople"/>
<Menu name="PeopleMenu" title="menu.viewPeople" page="/people.html"/>
At line 414 changed 1 line.
Now if you run __ant clean deploy__ and start Tomcat, you should see something like the screenshot below.
Now if you run __ant clean deploy__, start Tomcat and go to [http://localhost:8080/appfuse/mainMenu.html], you should see something like the screenshot below.
At line 417 changed 1 line.
[new-menu-item.png]
[ValidationAndList/new-menu-item.png]
At line 423 changed 1 line.
You've completed the full lifecycle of developing a set of master-detail pages with AppFuse - __congratulations__. Now the real test is if you can run all the tests in your app without failure. To test, stop tomcat and run __ant clean test-all__. This will run all the unit tests within your project. As a reminder, it should be easy to setup and test AppFuse from scratch using __ant setup-db setup-tomcat test-all__. Also, if you're looking for more robust examples - checkout [StrutsResume].
You've completed the full lifecycle of developing a set of master-detail pages with AppFuse and Spring's MVC framework - __Congratulations__! Now the real test is if you can run all the tests in your app without failure. To test, stop tomcat and run __ant clean test-all__. This will run all the unit tests within your project. As a reminder, it should be easy to setup and test AppFuse from scratch using __ant setup-db setup-tomcat test-all__. Also, if you're looking for more robust examples - checkout [Struts Resume|StrutsResume].
At line 428 changed 1 line.
Total time: 2 minutes 31 seconds
Total time: 4 minutes 21 seconds

Back to ValidationAndListSpring, or to the Page History.