In Struts programming, we often perform verification of parameters in the validate method in the Actionform. If there is a data submission that does not meet the requirements, you can return to the submission page here, not alarming the action. When displaying an error message, the label is usually used, but for the sake of obvious, it is often handled in the JSP page.
error: ul> font>, the error message is displayed in red font, and it feels good at this time, so we will handle the page that needs to display the wrong page. But an implied problem appeared, if the boss does not like the red, what should I do? Isn't it necessary to modify all the pages. The most common way is to write the front and rear font information to the configuration file, and it is convenient to modify it. Then let's define one yourself. No, in fact, Struts has taken into account this, as long as the following is increased in the configuration file, you can Errors.Header = error: errors.footer = ul> font>
and then write in the JSP page, Struts will automatically increase the head and tail, or is quite convenient.
At the same time, you can also use
Errors.PREFIX =
-
Errors.suffix = li>
Increase the end of each error