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


Please Help Members By Posting Answers For Below Questions

What is struts and why it is used?

500


What is spring hibernate and struts in java?

489


How properties of a form are validated in Struts?

566


What's the purpose of execute method of action class?

528


Explain the core end goal while using java struts?

524






What configuration files are used in struts?

529


What is xml based validation in struts2?

557


What are the differences between http direct and http indirect?

469


What is the purpose of @validations annotation?

570


Who makes the struts?

545


How nested beans can be used in Struts applications?

550


What is filter dispatcher in struts?

535


What are the classes used in struts?

624


How to display validation errors on jsp page?

568


What are Struts2 core components?

560