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 does the term struts mean?

756


Difference between struts and spring? Or why use spring, if you are already using struts?

754


What are the benefits of Struts framework?

746


How we can configured action mapping in struts?

779


What is java struts?

739


Does Struts2 action and interceptors are thread safe?

792


Which servlet does the struts framework use?

749


What is the purpose of execute method of action class?

768


Explain the life cycle of a request in struct2 application?

710


What do you mean by actionservlet?

777


Can we have more than one struts-config.xml file for a single struts application?

730


How do I install struts?

801


Is there a particularly good ide to use with struts?

720


Whats the difference between the default namespace and the root namespace?

753


What do you mean by a custom tag?

749