Properties File values to an Array List

I have a properties file that contains IPAddresses that I need to check. I was wondering if there was a way I could pass them to an ArrayList to make my life alot easier..thanks in advance..
[204 byte] By [Arch_Bytesa] at [2007-11-27 6:27:04]
# 1
You may find the java.util.Properties API useful.
BalusCa at 2007-7-12 17:48:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

ok.. so I read it over and now I have a vague idea on how to code it..

the thing is I keep getting the "The system cannot find the file specified" error.. do I have to include the path or something?

here's my code.. i call this method in JSF

public boolean LoadAllIpAddresses(String ipAdd) {

log.debug("LoadAllIpAddresses");

Properties props = new Properties();

String result = "";

boolean res = false;

try{

InputStream is = new FileInputStream("IPAddresses.properties");

props.load(is);

result = props.getProperty(ipAdd);

log.debug("propfileresult"+result);

if(result==null){

res = false;

}

else

res = true;

}

catch(Exception e){

log.debug("error at LoadAllIpAddresses "+e.getMessage());

}

return res;

}

Arch_Bytesa at 2007-7-12 17:48:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Check my replies in your former topic: http://forum.java.sun.com/thread.jspa?threadID=5158687
BalusCa at 2007-7-12 17:48:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

okay I was able to make the properties file work but now I've got a different problem.

<h:outputText styleClass="greenBoldText" value="#{messageController.message}"/>

This output text's value is from a Java Controller. There are no errors or exceptions thrown but unfortunately for me the message does not display.. I know that I am able to populate the message variable.. And the message controller is a managed bean in my faces-config file

here's my code snippet for the Java Controller

private String message="";

public String getMessage() {

return message;

}

public void setMessage(String message) {

ApplicationResources application = (ApplicationResources) FacesUtil.instance().getApplicationMapValue(FacesContext.getCurrentInstance(), "applicationRes");

log.debug("application:" +application);

log.debug("message="+message);

message = (String)application.getMessageProps().getProperty("1");

log.debug("message="+message);

if(message.equalsIgnoreCase("saveToDatabaseSuccess")){

message="Supplier Successfully Saved to Database!";

log.debug(message);

}

else if(message=="saveToDatabaseFailure"){

message="Error in Saving. Please Contact System Administrator";

}

else if(message=="saveParentCatSuccess"){

message="Parent Category Saved!";

}

else if(message=="saveChildCatSuccess"){

message="Child Category Saved!";

}

else if(message=="blank"){

message="";

}

else{

message="Error in system!";

log.debug("Error in system");

}

this.message = message;

}

now here's my code snippet for the faces-config

<managed-bean>

<managed-bean-name>messageController</managed-bean-name>

<managed-bean-class>com.shipserv.webui.controllers.MessageController</managed-bean-class>

<managed-bean-scope>request</managed-bean-scope>

</managed-bean>

wether its a session or request scope it still won't display I can't seem to find out what is wrong with it..

Thanks in advance..

Arch_Bytesa at 2007-7-12 17:48:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...