William A White

Ranch Hand
+ Follow
since Jul 01, 2004
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 William A White

This is just a shortcut provided for our convenience. The instantiation is done behind the scenes.
18 years ago
The Antarctic users must have some special qualities, since they capture 1.39% with only two users, and Central America can only capture 0.10% with nearly 15,000!
18 years ago
I doubt that it is possible to read previously output data from the console.

What you should do is just check the data before it is output.
18 years ago

Originally posted by Gregg Bolinger:


A. Why are your end users needing to see information that is sent to System.out and System.err? Better yet, why is your application writing messages to those streams?

B. This is something you didn't think to do? Capture those streams? You spent $20+ dollars to learn that? To me, that doesn't seem a fair tradeoff. For you that is.




Everybody has to learn somehow... I did a very similar thing when I was starting out in Java development and it got the job done. Today, I would never do it, but neither would I think it a stupid thing to do. If you're on your own with no senior developer to tell you what's possible, the only way to grow as a programmer is to experiment and read what others have done. The disadvantages of this approach may become apparent (it's perfectly adequete in some cases, if inelegant) and spur further development.

I haven't read the book in question, but $20 is not so bad.
18 years ago
Thanks everyone, I'll move it over to a servlet.
18 years ago
JSP
Does anyone have a method of debugging the scenario where a JSP causes an IllegalStateException as follows: "java.lang.IllegalStateException: getOutputStream() has already been called for this response"

These are extremely frustrating as I don't know how to find any evidence of what is actually causing the underlying error.

Here is my real-life example:

I have a JSP that reads in a file, does some simple string replacements, and outputs the file again. There is a whole framework in the background that does the actual work.

I created a file in Excel and saved it as an HTM file and used that as the template - works fine.

Using the exact same page, I tried using a simple .txt file, an .RTF, and others. All failed. No exception is caught by the try-catch block surrounding the whole page. Tracing the execution shows that every statement on the JSP page is executed before that IllegalStateException interrupts the application.

I've got no idea what to try!
18 years ago
JSP
For quite a while the Design Patterns pigtail girl was on a billboard along my way to work, so she's my favorite by virtue of constantly seeing her. 8^)
18 years ago
If you've got a site that is mostly static content it was a good performance boost to let Apache serve it up and just pass the JSP through to Tomcat. I say was because I don't believe this is true if you have Tomcat 5, and probably a couple versions before that.

Still, here are some other reasons from the horse's mouth:
http://jakarta.apache.org/tomcat/faq/connectors.html#integrate

It's not a lot of fun to set it up.
18 years ago
I finally have a hardware combination that works well with power management, so I have my system set to go to standby after 5 minutes of idleness. It takes about 15 seconds at most to come back to life, and saves a few dollars a month in power bills.
18 years ago
I don't have any example code on hand here, but I have a few projects that do this.

I just have a simple Javascript function that creates and displays a DIV at an appropriate place for the form control when the mouse is detected over the control. You can also do it like a 'real' tool tip that follows the mouse pointer, but I found it wasn't smooth or worth the extra effort/processing.

Another approach is to create all the tool tip DIVs ahead of time and make them all hidden, then visible as needed when the cursor is over the relevant form control.
Depending on the kind of analysis you need to do, you probably don't need to load the whole thing into memory. Just read it line by line, discarding each line as it is read and analyzed.
18 years ago
If you don't know what kind of object you want to create, this code lets you decide at run time.

You'd usually make use of it in conjunction with reflection, or some kind of factory that made different objects.
18 years ago
You can get around this by making a hidden dummy button and making it the active button when you want the button group to appear "unselected".
18 years ago
Not yet... I was starting to worry I had missed out somehow.
It looks like you want to use a static method from the EasyIn class, but that class is not available to your code. Do you have a .class file for EasyIn? You need to import it into your program if you do.
18 years ago