If you are careful, you can also find that there is still a problem in the form, that is, "age" starts to show blank rather than 0. To solve this problem, we can add "emptyInt = 0" to the blx: getProperty and blx: setProperty flag, so that the bean region is initialized to 0. If the entered age is not a valid value, 0 is used to indicate null characters.
Another small problem is that if an error occurs and our old book contains "GetName. jsp", we will get two "<HTML>" marks. A perfect solution to this problem is to remove out. println and pass the error as follows:
<%
If (haveError ){
Request. setAttribute ("errors ",
Errors. toString ());
PageContext. forward ("GetName. jsp ");
} Else
PageContext. forward ("NextPage. jsp ");
%>
You can run "request. getAttribute" in GetName. jsp. If the returned value is not null, an error is displayed. Keep this exercise as part of this tutorial.
Finally, let's talk about the exercises in this section first. Read the SQL mark in the mark library document and create a database table. Then write a JSP file with a FORM and a selection box on the FORM; then, use the SQL flag to create a selection box based on the database table.