Hi
I am using Spring 3.0. Can i read a property file from a localdrive eg: C:\prop\mylogin.properties(not under webapps/application server)
mylogin.properties
login.heading=Login
login.username=Username
login.password_blank=Password cannot be blank
I want to use the above in my Validator class(java bean class). Please Note : I using MultiAction Controller not SpringFormController
public class MyUserValidator implements Validator
{
@Override
public void validate(Object command, Errors errors) {
String msg=null;
//some conditions checked
String msg=login.password_blank;-------->get from property file ??
errors.rejectValue("User",msg,"defaultvalue");
}
Hi we are using resource bundle, not sure how this will need to be used within validator?
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" lazy-init="true">
<property name="basenames">
<list>
<value>${deployment.properties.path}/xyzsite/mylogin</value>
</list>
</property>
<property name="cacheSeconds" value="${deployment.properties.cache_in_seconds}"/>
</bean>
What change i cud make in the answer u have mentioned if resource bundle is been used?
for example if i want to set a PageSize int pagesize=5; ---> get this from property file
mylogin.properties
login.heading=Login
login.username=Username
login.password_blank=Password cannot be blank
login.page_row_size=5