Wesley Baker

Ranch Hand
+ Follow
since Aug 20, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Wesley Baker

3rd party library. Apache POI, actually. I changed the code around because it helps me work through the problem and usually find a solution, but not this time unfortunately. Here is the actual code I'm using:



I always use the same CellStyle object "gothic10error" to pass to it, but it seems like it would be a unnecessary performance hit to do all that CellStyle creation code every time I call the method.
12 years ago
Suppose I have a private method inside my main class that performs a repeatedly used process:



The design problem is that the FontStyle that I will always pass to this method will be the same FontStyle object, but I don't want to create it inside the method because it will be re-created unnecessarily every time the method is called. It just seems like bad design to always pass the same object to a method. Is there a better way?
12 years ago
Hey guys, I'm using Glassfish 9.1 (or Sun Java System Application Server 9.1 as it was known back then).

I know this is an old version, but is there any way to keep or backup an existing web deployment? I am getting ready to replace the deployment with an updated version of the website, but want to be able to regress back to the existing copy if something doesn't work right. I did a search on the server and couldn't find the original WAR file.

Any ideas?
Well, a couple of things. First, once you FTP a file to another machine, you only sent a copy of it. You still have the file on the local machine, unless you deleted it.

Second, you can't make changes to the FTP'd file. You would have to make changes to the local copy, and then re-upload it. However, if you can connect that FTP location as a network share instead, then you could modify it directly. I think that was outside the scope of your question, though.
12 years ago
When building a web app, what is the best way to organize a set of methods that don't really have anything in common, other than they are all frequently used by different servlets?

For instance, I have a function that calculates tax based on state, and another that prints a predefined list of error messages, and another that validates credit card numbers. All of these functions are frequently used by different servlets in different packages, and up to this point I have been stuffing them all into one class, usually with a name like "CommonUtils", or "CommonMethods". Is this common practice, or is there a better way to organize these? Should I really have a separate class for each of these, since they have different purposes and no commonality?
12 years ago

Stefan Evans wrote:
I would expect alert(${exclusion.key}) to fail without quotes around the value being alerted.
ie alert('${exclusion.key}');



HA! You nailed it, Stefan. That has been bugging me (no pun intended) for hours. I'm so used to Java just "understanding" that when you pass a String, it comes with its own necessary quotes. Adding the single quotes outside the ${exclusion.key} did the trick.

Thanks a bunch!
13 years ago
JSP
Yes, that's what actually in the code that I'm having problems with. If I do this:



I get the expected pop up telling me the values. However, if I do this:



I get nothing. No pop up. It's like the JavaScript is crashing, but I can't figure out if it's because of the String that is being passed to it, or if it's something quirky with JavaScript itself. I even tried:



But that didn't help.
13 years ago
JSP
I use Java extensively for both server side and client side coding. The client side are usually simple applications that automate manual functions, such as pulling files from FTP servers, parsing files and loading them into a database, etc. Could I use Ruby or Python for that? Sure, but I would much rather have Java on my side when I have to trudge through a 1.5 gig file and get it loaded into MySQL in the next hour.
13 years ago
I am trying to pass a Map key and value to two separate JavaScript arrays:



There are no Java errors, and if I use the debugger and step through it the correct values are displayed for each key and value iteration. However, JavaScript seems to be freaking out over the following line:



Because if I add an alert() to display the key, it won't ever pop up. The page finishes loading and nothing ever pops up. The value works fine though.

Am I doing something wrong trying to get the key? I've used the c:forEach before and never had this problem.

Here is the method that is supplying the Map:

13 years ago
JSP
Hello all -

I am having a conundrum with Stripes and some design issues. I have a Wizard ActionBean that is controlling about 4 different pages that all contain forms. The problem exists with two select fields on the first page:



Only one of those select boxes will ever be used, but later on down the line I will manually (inside the Wizard ActionBean) overwrite the value of the other. So, for example, if the "uploadAndProceed" button is pressed, it will take the value from fileId and do some processing, then later on manually populate the evalFileId value. Alternately if the "proceed" button is pushed, it will take the value in evalFileId, do some processing, then later on manually populate the fileId value.

Because of the Wizard annotation, Stripes is forcing the value of the non-used value throughout the entire process. So even if I manually set it to something else inside the ActionBean, it gets reset by Stripes on the next page, likely due to the hidden field it creates to propagate the value.

So my question is, where can I write that value that it will actually stick, and Stripes won't override it?
Some of my programs that write to a log file will get OutOfMemoryErrors if the log file becomes too big. This seems odd to me, since I assume (ass=u+me) that the java.util.logger does not attempt to keep all previous log entries in memory for the duration fo the JVM, or until the logger is garbage collected. Is this not true? I am using J2SE 1.6.

I can post some code if needed, but I figured this was more of a "why does Java do this" question.
15 years ago
I am trying to renew an SSL certificate with Verisign, and they recently upgraded their requirements to a minimum 2048 CSR keysize, so I can't use the old CSR I had originally.

When trying to generate a new CSR off of the original key pair, I am using:



and it creates the file just fine. However, when i try to submit it, Verisign says its a weak key and is not 2048 or above. So I tried the same command without the keysize option:



and it creates the exact same file. According to the documentation, it defaults to 1024.

So my question is, why is keytool not recognizing the keysize option?
15 years ago
This on the Netbeans integration of Glassfish v2.1. It works fine when I use debug mode, and when I deploy the application to the production server, but when I choose 'Run' for the project in Netbeans, I get that error. And it's only recently started happening. The only other log file is the Glassfish server log file, and it is not recording this error.
Hello all -

I am getting a deployment error from Netbeans 6.8 on a web app. This is a recent problem (it deploys fine to the production server, and works just fine in Debug Mode). Can anyone familiar with the inner workings of Netbeans give me a hand with this error message?



The line in the build-impl.xml that it is referencing has:

---FIXED---

Must have been some weird classpath issue (most likely PEBKAC), because I placed the file in another directory and manually added that directory to the Glassfish classpath and it works now. Go figure.