In this lesson, you will edit the form bean source file and the Java™ resource
file so they work in this Struts application.
- In the Project Explorer, Double-click dateData in
the computeDay node. The DateData.java file
opens.
- In the DateData.java file, find this line
of code near the bottom of the file:
ActionErrors errors = new ActionErrors();
- Immediately after this code, insert:
if (year < 1582)
{
errors.add("year",new org.apache.struts.action.ActionError("pre_gregorian"));
}
- Save and close DateData.java.
- In Project Explorer, navigate to .
- Double-click ApplicationResources.properties.
- In the ApplicationResources.properties file,
remove the # from the lines that begin with errors.header and errors.footer.
- Add the following code at the bottom of the file:
pre-gregorian=<li>Date is before 1582, the year the Gregorian calendar began</li>
- Save and close the file.