how will you view ur jsp page to the client by using
properties file?
Answer Posted / jane priscilla
Instead of having hard-coded messages or error messages in
the framework, Struts Validator allows you to specify a key
to a message in the ApplicationResources.properties (or
resourcebundle.properties)
File that should be returned if a validation fails.
For ex:
In ApplicationResources.properties we'll have such entries
study.empNo=EmployeeNo
study.empName=EmployeeName
error.name.required=field is mandatory
error.empNo.required=mandatory
The following code will explain u how to use this resource
Properties in the jsp
<tr>
<td><bean:message key="study.empName" />:</td>
<td><html:text property="employeeName"/></td>
</tr>
<html:messages id=”messages” property=”name”>
<font color=”red”>
<bean:write name=”error.name” />
</html:messages>
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Where can I get a copy of struts?
How can link tag’s action attribute be used?
Explain the difference between jakarta struts and apache struts?
What is the purpose of @conversionerrorfieldvalidator annotation?
What is the difference between forwardaction and includeaction?
What are the classes used as part of struts framework ?
Explain about the
what is meant by Struts Validator Framework?
What's mvc pattern ?
What are the struts2 configuration properties that control file uploading process?
What is meant by custom tags?
What does validation interceptor?
How can we upload files in Struts2 application?
What are the life cycle methods of interceptor?
What is the purpose of @before?