i'm developing a web application using spring 3. i'm using tomcat 6 as the web container.
in my web.xml file i bound the file named applicationContext.xml as the spring definition file.
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
from inside the applicationContext.xml file i'm trying to initialize a array list variable using the spring bean definition. i'm following the below configurations.. (im using jidea)
<bean id="registationController" class="com.test.RegistrationController">
<property name="registrationService" ref="registrationService"/>
<property name="validUrlsList" ref="myList"/>
</bean>
<util:list id="myList" value-type="java.lang.String">
<value>10.1.200.104</value>
<value>10.1.200.205</value>
</util:list>
i have loaded the
xmlns:util="http://www.springframework.org/schema/util"
namespace, and in RegistrationController.java class i have generated the getter and setter for the validUrlsList variable, jidea shows that my definitions are correct and i have properyly bound my vaiable to the bean definition. but when i try out the code it doesn't initialize the validUrlList variable? it's giving a null value? any thing i'm doing wrong here? any suggestions to sort this out?
java code is as follows.,,
private ArrayList validUrlsList;
public void setValidUrlsList(ArrayList validUrlsList) {
this.validUrlsList = validUrlsList;
}
public ArrayList getValidUrlsList() {
return validUrlsList;
}
then i call the method getRemoteIp by just passing the variable as follows.
if (getRemoteIP(req, validUrlsList)) {
-- Regards,Rangana
List<String>and notArrayList<String>.