Apple WebObjects 3.5 User Manual
Page 114

Chapter 7
Managing State
114
// Java DodgeLite Application.java
public class Application extends WebApplication {
public ImmutableHashtable dodgeData;
public ImmutableVector prices;
public ImmutableVector sortBys;
public Application() {
super();
String filePath = resourceManager()
.pathForResourceNamedInFramework("DodgeData.dict", null);
if (null != filePath) {
try {
dodgeData = new ImmutableHashtable(new
java.io.FilePath(filePath));
}
catch (Exception e) {
//...
}
} else {
// ...
}
int priceValues[] = { 8000, 10000, 12000, 14000, 16000, 18000,
20000, 25000, 30000, 50000, 90000};
MutableVector a = new MutableVector(); Number num = new Integer(priceValues[i]); } String sortByStrings[] = { "Price", "Type", "Model" }; for (int i=0; i a.addElement(sortByStrings[i]); } } // WebScript DodgeLite Application.wos - init { id filePath; [super init]; pathForResourceNamed:@"DodgeData.dict" inFramework:nil]; if (filePath) dodgeData = [NSDictionary dictionaryWithContentsOfFile:filePath]; //... 50000, 90000); sortBys = @("Price", "Type", "Model"); }
for (int i=0; i
a.addElement(num);
prices = (ImmutableVector) a;
sortBys = (ImmutableVector) a;
id dodgeData;
id prices;
id sortBys;
filePath = [[self resourceManager]
prices = @(8000, 10000, 12000, 14000, 16000, 18000, 20000, 25000, 30000,
return self;