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

How we can controlled duplicate form submission in struts?

509


How can duplicate form submission be handled in struts 2?

527


What is the purpose of @createifnull annotation annotation?

607


What is purpose of execandwait interceptor?

573


What is http redirect?

559






What is pojo in struts2?

557


What are interceptors in struts 2?

574


What is actionmapping?

590


What are the different kinds of actions in struts?

545


Are the struts tags xhtml compliant ?

533


What is the purpose of interceptors?

525


What is struts framework in java?

524


How to use forward action to restrict a strut application to mvc?

588


What are result types in struts?

562


What are action errors?

558