how will you view ur jsp page to the client by using
properties file?

Answers were Sorted based on User's Feedback



how will you view ur jsp page to the client by using properties file?..

Answer / 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

how will you view ur jsp page to the client by using properties file?..

Answer / mohan

Another way is that you can do the validation in the
ActionForm, and display messages or the error messages by
using errors.add() method.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Struts Interview Questions

How is a lookup dispatch action created?

0 Answers  


What is the purpose of @validations annotation?

0 Answers  


Is form beans are serializable or not?

11 Answers   College School Exams Tests, Magna Infotech,


What's mvc pattern ?

0 Answers  


List some bundled validators?

0 Answers  






how canu done chechin and check out of u r project using with sample examples?

8 Answers   CTS, Logica CMG,


How action mapping is configured in Struts?

0 Answers  


What does action do in struts?

0 Answers  


Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?

0 Answers  


In ActionClass we can use only one action i.e execute(), but in DispatchAction we can use multiple actions.My question is , we can use multiple actions in Action class if(action.equals("add") if(action.equals("update"). Then when to use Action and DispatchAction which is frequently in webapplications.

2 Answers  


Where should struts xml be placed?

0 Answers  


Does Struts2 action and interceptors are thread safe?

0 Answers  


Categories