how will you view ur jsp page to the client by using
properties file?
Answers were Sorted based on User's Feedback
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 |
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 |
What is struts2 namespace?
How Struts internally works? For Example if we type the URL "/login.do" how the process goes internaly? How the struts-config.xml loaded?
What are the differences between http direct and http indirect?
Is form beans are serializable or not?
11 Answers College School Exams Tests, Magna Infotech,
Can we have more than one struts-config.xml file for a single struts application?
what is struts? why Struts?
How action mapping is configured in Struts?
how you provide security in your banking project
How to pass runtime Parameter in Struts1.2?
how handle when client send multiple request at atime for multiple servlets servlets?
What is use of i18n interceptor?
What is the life cycle of actionform?