Renders the queued errors messages.
String getMsgs(String property)
|
- Parameters
-
- property
-
The category of errors messages to render.
- Returns
-
The formatted error messages. If no errors are queued, an
empty
String is returned.
This method renders the queued error messages as a list. If the method
is called without a parameter, all queued errors are rendered. With the
parameter property the list of rendered messages can be
limited to a specific category of errors. Error message texts
are looked up in the message resources. If a message text
cannot be found, the message key will be displayed instead.
The method expects a message header and a message footer
to be defined in the message resources. The corresponding
message keys are errors.header and
errors.footer .
Assuming that the message resources contain the following
definitions:
errors.header=Please correct the following errors:<ul>
errors.footer=</ul>
error01=<li>The field Expiration Date is required.</li>
error02=<li>The input is not a valid credit card number.</li>
...
|
|
an error message would be rendered as follows:
Please correct the following errors before proceeding:<ul>
<li>The field Expiration Date is required.</li>
<li>The input is not a valid credit card number.</li>
</ul>
|
|
|