GreatWebGuy Self-proclaimed greatness is a hard thing to prove.

21Feb/0813

Suckerfish DHTML dropdown menu with JQuery

DHTML dropdown menu's have been greatly improved in terms of accessibility, standards compliance, and weight using the Suckerfish technique of building pure CSS-based menus and then attaching a small javascript that allows Internet Explorer 6 to mimic the CSS hover method. Once the die-hards hanging onto IE6 let go, we won't have to worry much about this anymore, but for now it looks like it's going to linger for a bit.

I've been using JQuery for a bit now for all of my DOM manipulation and have found great savings in the amount of JavaScript code I have to write and the ease in which it can be employed in a CSS based site.

While this is generally the last piece to get IE working with your menu's, here's the JQuery code to replace the suckerfish Javascript, which is being used on this site now. If you're familiar with suckerfish, the JQuery code should be readable enough to figure out what's going on.

6Jan/0832

PHP (WordPress) development using Eclipse and XAMPP

As can be determined from my other posts, I'm a Java Developer by trade and Eclipse is my editor of choice. Now I have gone to the darkside now and then for some good out of the box software, such as WordPress, which as you may know is written in PHP. The main reason I chose WordPress was because of it's great community, it's focus on best practices, and the huge number of plug-ins enabling any blog functionality you could imagine, this mix just doesn't seem to be present in an Open source Java-based blog software package. So to the point, I want to be able to develop my WordPress themes, and any other PHP projects for that matter, in the same manner I develop Java applications - In my favorite IDE, which is loaded with features we won't discuss here, with the ability to test the changes locally before I promote them to production. Using the Presentation tab in the WordPress admin console is not an optimal solution or a good development practice. Now these instructions aren't for the faint of heart and I will assume that you most likely have some sort of programming background, or general cognitive skills and that you can get by without a bunch of pretty pictures and click this, click that, click ok, hopefully you've installed shit before. These instructions are geared towards Windows, nobody's perfect, but all the software used here is available for Linux, you may just have to do a little work to make that jump.

List of installs, you can stop here if you don't need me

XAMPP Lite 1.6.5
JDK 1.6
Eclipse 3.3
PHPEclipse 1.1.8
WordPress
MySQL GUI Tools

20Dec/0711

URLRewriteFilter Servlet Filter problem in WebSphere 6.1.0.5

I recently wrote up an article on SEO Friendly URL's for J2EE frameworks, while my tomcat implementations and WebSphere 5.1 implementations of the URLRewriteFilter were seemless, I ran into a problem on WebSphere 6.1 that caused me to rack my brain. The Output urls in the page were being rewritten fine, which is usually a gotcha if you forgot to response.encodeURL, but none of the inbound rules seemed to be rewriting back to the original url. In fact I was receiving a big fat 404 error and nothing in the console indicating that the URLRewrite Servlet Filter was not even being invoked. After several hours of Googling, I found that the guys over at Atlassian had run into the same problem with their products Jira and Confluence.

Apparently IBM made a change in 6.1.0.5 that is causing this problem:

WebSphere 6.1.0.5 and above checks if a URL is mapped to a servlet or a file before it puts a request through the filter chain. As we do not have a servlet or a file that is mapped to a URL:

http:///a/AZ/

WebSphere 6.1.0.5 sends a 404 to the user before giving the UrlRewrite filter a chance to redirect a URL to the correct place.

To make the filter invoke on a request without a servlet mapping you should be able to do the following in the WebSphere Admin Console:

- expand Servers -> Application Servers -> <server> -> Web Container Settings -> Web Container -> Custom Properties
- select New and then enter "com.ibm.ws.webcontainer.invokefilterscompatibility" as the property name and "true" as the value
- save the update and restart the server

Hopefully this explanation helps the WebSphere community with their SEO strategies by letting them rewrite their urls.

16Dec/0725

Java image resizer servlet

I'm working on a photo gallery application running on Java 6 using Tomcat 6, JQuery for the client side, and images and xml generated from Picasa. I needed several sizes of images for thumbnails and animations and I wasn't about to create multiple image sizes with Fireworks (I'm a lazy developer). Doing what every lazy developer does, I search Google for an image resize solution that would run on the application server and give me the sizes that I needed and take the manual work out of the equation. I found several PHP examples and disjointed Java examples, but no complete solutions. So, unfortunately I had to do some work to put something together.

21Sep/0716

Decompile Java Classes automatically in Eclipse with JadClipse

There always comes that time, when you're debugging a Java application, when you get to that compiled code inside that open source jar that you added to make your life easier. Whether there's an actual bug or you're just trying to understand some behavior or weirdness you're getting from calling this third party API, sometimes it just helps to see the source. If you're using Eclipse you're in luck, things just got easier, well they've been easy for awhile, but if you weren't aware of jad they just got easier. If you download and unzip the most recent version of JAD, Java's fast decompiler, and add the appropriate Jadclipse plug-in for your version of Eclipse, set a little configuration and your workspace will decompile compiled code automagically. No more ugly class outlines, just raw source code. This is by far one of the essential tools a Java developer should have in their tool kit, just like Firebug for a Web developer. Here are some step by step instructions to get you going, of course I'm assuming you're already using eclipse and have an existing workspace.

  1. Download the latest version of JAD that works with your Operating System from http://www.kpdus.com/jad.html#download
  2. Unzip the JAD executable to a memorable place on your hard drive, I just stuck mine in the bin directory of the JDK
  3. Head over to http://sourceforge.net/project/showfiles.php?group_id=40205 and download the version of the Jadclipse jar that matches your eclipse version, lots of choices here 3.1, 3.2, and 3.3 are covered.
  4. Copy the jar file over to your eclipse/plugins directory, this all depends on where you unzipped and installed Eclipse
  5. If you're workspace was open during all of this, close it and reopen it, if not open it.
  6. Click Window -> Preferences
  7. Expand +Java -> Click on JadClipse
  8. In the Path to decompiler put in the full path to JAD, or put jad in the path variable for your OS, in my case it was C:\Program Files\Java\jdk1.5.0_05\bin\jad.exe
  9. Now go looking in Open Type -Ctrl + Shift + T - for a class you know is in a jar or compiled in your workspace and voila it should open decompiled, classes will also decompile during navigation of method calls from the Console, or their calling classes and during debug
  10. Tagged as: , 16 Comments