Tim Hagberg

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

Recent posts by Tim Hagberg

I apologize for the late response. It turns out there was some malformed CSS that apparently Firefox was simply ignoring. I'm no expert on this, but I'm assuming CSS files must be stored somewhere on the DOM, and if that's the case, Firefox wasn't putting the malformed CSS on the DOM. That would explain why I was seeing the new CSS entries when putting in the full URL to the stylesheet in the address bar. Thank you both for your responses and advice.
10 years ago
I have a personal Java-backed website I'm building with Tomcat, and I've run into an annoyance. After making some changes to a stylesheet, when accessing the website from a browser I was getting the old version of the css file. I assumed it was just the browser (Firefox) that was caching the file, but I've tried clearing the browser's cache and it has not helped. If I look at the file on the server or type the url of the css file in my browser, I see the updated version, but when examining it through Firebug I see the old version (and by looking at the rendered page it is obvious that it is using the old version). To rule out Firebug I have tried turning it off and closing/reopening Firefox and loading the page again, but that has not helped. Especially strange is that I tried changing the name of the css file (and obviously also changing link tag on the page as well) but this has not helped. At this point I am wondering if Tomcat's servlet container stores compiled JSPs somewhere, and if that is true perhaps it is storing linked stylesheets as well.
10 years ago
The first time you call nextInt() (right before your while loop), you're reading your first number in. Then before you do anything with that value, within the body of the while loop you are calling nextInt() again.
10 years ago
Have you tried running the setup file as administrator?
10 years ago
Is this on a home computer or a work computer? Perhaps you do not have the permissions to run the file.
10 years ago
One of the advantages of C and C++ is that they are not platform independent. This may seem backwards at first, but because C and C++ compile to native code, they can take better advantage of the platforms they are specifically compiled for. With Java, you are running your code over an additional layer of software. While this is nice in that you don't need to learn the idiosyncrasies of each platform you would like to develop for and compile to, you're never going to get the performance you get when writing good C or C++ code.
10 years ago
Arrays are zero indexed, which means the first element on an array is at index 0. This is because of how pointer arithmetic works. An array identifier (the name of the array) is essentially a memory address of where the array begins in memory. For an int array called foo[5], you have 5 elements on the array. The actual indices of the elements range from 0-4. When you try to get foo[0], what you are essentially saying is go to the memory address specified by foo + the datatype size (32 bits) * the index I specified (0) and retrieve the first range of bits of the datatype size (once again, 32 bits). Following this, if you were to access foo[2], you would be going to the memory address of foo + (32 * 2) and reading the first 32 bits from that location. I hope this clears up a little of how arrays work for you.
10 years ago
They need to be on the same line like this:
I believe the timeout limit is container specific. You might be able to get better help if you specify what container you're using.
I believe if you download the J2EE SDK you receive an executable which will place the classes in your JDK, so you shouldn't have to worry about any of that.

Here's the download link for the SDK.
The EJB Object that intercepts requests to your bean is a container generated object which implements your business (or component) interface, which in turn extends the EJBObject interface. The EJB Object is created when the client makes a request for one from the home object. I believe all of this will be explained in greater detail further in the book. Also, I'm assuming you're referring to EJB 2.1; if you're reading about EJB 3.0, I'm not sure how things work with that.
I've just discovered some user specific logic occurring within the init methods of several servlets. This has me a little confused as this logic executes every time someone performs a certain action, but I thought the init method was only called during the initialization of a servlet. My first assumption was that these servlets were being destroyed after every use, and thus the init method was being called every time one of the respective actions was performed, however I can't find any evidence of destroy methods being called. Has anyone seen anything like this, and are there easy ways to find out if a servlet is being destroyed before the container is shut down?
12 years ago