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 discontinuous strut?

692


What is the difference between struts and spring?

699


In how many ways duplicate form submission can occurs?

776


What are action classes in struts?

711


Explain about logic match tag?

790


What’s the difference between validation.xml and validator-rules.xml files in struts validation framework?

783


What is switchaction?

835


Explain the difference between plain-validator and field-validator in struts?

709


What is the different actions available in struts?

740


What does execandwait interceptor?

773


How is declarative handling of exceptions done in struts ?

689


What are the benefits of Struts framework?

736


How can we handle exceptions thrown by application in Struts2?

726


What is the purpose of form-beans tag in struct-config.xml?

728


What is struts?

757