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
What is the difference between shocks and struts?
What is the purpose of @requiredstringvalidator annotation?
Explain about token feature in struts?
What is the use of execAndWait interceptor?
What is struts validator framework?
how to debug struts project in netbean ?
How do struts work?
How tag libraries are defined in Struts?
How is the mvc design pattern used in struts framework?
Explain the difference between plain-validator and field-validator in struts?
How are interceptors and servlet filters different?
What is the purpose of @conversion?
How is declarative handling of exceptions done in struts ?
What is xml based validation in struts2?
Which class of struts is responsible to converts data types from string and vice versa?