Mary Shields

Greenhorn
+ Follow
since Apr 29, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mary Shields

I went ahead with the properties file, and delimited the values with commas. Then, used String.split to carve out the individual fields. The amount of data I'm using is trivial, so this works for me.
13 years ago
What I have is a table that uses a key to get multiple fields related to that key, for example, use 'name' to get the other fields (address, phone number, etc.). The values in the table change rarely, and there are very few entries. Maybe the properties file isn't the way to go?
13 years ago
Is there a way to incorporate a multi-dimensional 'array' in a properties file?

In my situation, I want to look up a key and find associated field values for that key. For example: Name(key), address, phone number, etc.

Thank you.
13 years ago
You could try implementing the factory pattern:
-----------------------------------------------------
abstract class City{
abstract void process();
}

class Paris extends City{
void process(){
//do paris processing
}
}

class cityFactory {
public City createCity(String city) {
if (city.equals("Paris")) {
return (City)(new Paris());
}
}

class doProcessing {
public void handleRequest(String inCity){
CityFactory factory = new CityFactory();
City city = factory.createCity(inCity);
city.process();
}
}

-----------------------------------------------------------------------
code needs a little work, but that's the general idea.
14 years ago
Greetings everybody!

I'm writing a class that will be called via SOAP by a vendor of ours. Using Spring, I was able to get the WebApplicationContext from the HttpServletRequest in my test servlet. However, when my component is called by our vendor, it will be a SOAP call (not servlet). How can I determine the context without using a servlet, and without using HttpServletRequest? Or, can I use HttpServletRequest in classes that do not behave as servlets?
Hello - is there a way to get the marshaller to create empty tags for fields (in the corresponding object) that have no data in them?

Thank you!
I have the name of the class using reflections. How do I create a new instance of another class using that name concatenated with another? For example.

I know the name of the class is Thing (by use getClass()) and I want to create an instance of ThingDescriptor (by concatenating Thing with Descriptor).
14 years ago