Rick Stabile

Greenhorn
+ Follow
since Sep 22, 2005
Merit badge: grant badges
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 Rick Stabile

Hmmm, that wasn't my impression. I had the Java 1.1 Programmer Cert, but couldn't get signed up to the SCWCD. So, I think that statement should be qualified to "Java 2 programmer certification".

It wasn't too bad to take the SCJP 1.4 exam, though -- no more AWT? Yay! :-) -- so I'm not complaining. I actually enjoyed the exam, and was gratified to find out how much the language and the libraries had improved.

Now, I'm trying to study for the SCWCD exam.
I did something similar recently. Only I exposed a class's fields rather than its methods using the Class.getFields() method. I talk about it here: Reflection made my life easier today..

Rather than use the getFields() method, you would probably want to use the getMethods() method. Look at the javadoc for the Class class - Javadoc for Class. There's a lot of interesting stuff there.
18 years ago
How about trying this workaround? I'm not sure if it's quite right for you, but it's a place to start. By the way, I'm sorry that you have to deal with such an inflexible API.

Create a class that wraps the objects you're inserting into your TreeMap.

Give the new class (InsertOrderObject ?) an int instance variable like this:
private int insertIndex;

Keep a counter someplace (maybe a static for InsertOrderObject?) and increment it every time you insert one of these things to your TreeMap.

Make it so that each object you insert into your TreeMap has an incremented insertIndex. E.g., the first one would have insertIndex == 0, the second insertIndex == 1, etc.

Now, you can create a Comparator for your new InsertOrderObject class that is based on the insertIndex.

...
Ok, now back up a bit (sorry). First, insert all of the objects you would have inserted into your TreeMap into a Map that maintains insert order.

Now, iterate through your Map. Create a new incremented InsertOrderObject based on the object retrieved from the Map. Add the InsertOrderObject to your TreeMap.

Once you've completely iterated through your original Map, your TreeMap will consist of InsertOrderObjects sorted by the original order in which you inserted the underlying objects in your original Map.

This might work . . .
18 years ago
If you say something is "protected" it means that subclasses should have access to it.

This is what you would do if you define a particular class in one package, and then subclass it in another. In such a case, the default package-level access would be too restrictive, and "public" access would blow any encapsulation you're trying to do out of the water. So, "protected" is the way to go.
18 years ago
Does anyone know anything about the book, Sun Certified Web Component Developer Study Guide, by David Bridgewater? According to Amazon, it was supposed to have been released on September 30, but it still not available.

I know, it's still early. And I won't put off taking the test based on the release of this book. Still, it would be nice to look through it. :-)
Hello.

I am attempting to integrate Tomcat (5.0.28) and Apache (2.0.54) by following the instructions at: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/proxy-howto.html.

So, I have two lines in my httpd.conf that look like this:

ProxyPass /myapp http://mydomain.com:8081
ProxyPassReverse /myapp http://mydomain.com:8081

And I have a line in my server.xml file that looks like this:

<Connector port="8081" proxyPort="80" proxyName="www.mydomain.com"/>

This works . . . sort of.

When I point my browser to "mydomain.com/myapp", the "Welcome to Tomcat" screen comes up, but not the images. Their addresses all lack the "/myapp" part, so of course they're broken E.g., "http://www.mydomain.com/tomcat.gif" should be "http://www.mydomain.com/myapp/tomcat.gif", but it's not.

This further complicates things if I want to go to the manager application --- by manually entering the address with the "/myapp" section, I do ok. But that's annoying.

I know that there must be a simple solution to this --- I am just not finding it.



Thanks.
18 years ago