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

2May/0820

Converting a Java project to a Dynamic Web project in Eclipse

Once a project is created in Eclipse Europa of a certain type, it's not the most straight forward process of changing the project to a different type. For example you have a project that Eclipse considers to be a Java project, but it's actually a Web Project, you don't get to take advantage of all of the features available for Web Projects, such as deploying to a local tomcat server, unless Eclipse is aware that it's a web project. This has to do with the project settings and what eclipse considers the "Nature" of the project.

24Apr/0824

Default html button submit on enter with JQuery

I basically needed the update button to be the default action on clicking enter in the form, but there were multiple submit buttons in my form and they weren't in the order I needed due to UI design. This was a quick and dirty solution to select an html submit button and make it the default when a user clicks enter from certain or all input elements on the form. It could be tweaked to give specific behavior to specific types of input boxes, such as invoking a tab on enter in between required elements, but the general idea is using jQuery to click the default button when the user hits enter.

23Feb/0834

Simple Cross Site Scripting (XSS) Servlet Filter

Ran into some issues on some of our Java sites today and needed a quick fix to protect the sites from malicious Cross Site Scripting (XSS) attempts. If you're not aware of what XSS is and have websites that have sensitive user data, you may want to read up, you're probably vulnerable, which means your users are vulnerable. I'm not claiming this is a perfect solution, but it was easy to implement and corrected the vulnerabilities with form and url injection. We basically have a Servlet Filter that's going to intercept every request sent to the web application and then we use an HttpServletRequestWrapper to wrap and override the getParameter methods and clean any potential script injection.

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