Form input focus always seems a pain to me, I don’t like all of the generated inline javascript that struts or other frameworks add to accomplish this and it always seems to be one issue or another. So here’s a simple solution that applies focus to the last input element in the document that has a class of focus. Short and sweet, nothing fancy, requires the jQuery library of course.
Continue reading

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.
Continue reading

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.
Continue reading

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.
Continue reading

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.

Continue reading

I’ve recently been working with an SEO firm to improve our “keyword density”, structure and several other things on our public website. In their long list of recommendations was the task of producing nice pretty urls with relevant keywords, dashes instead of underscores, and so on, easily said, not so easily executed or so I thought. Our architecture in a nutshell is Apache web servers, fronting WebSphere application servers, running a Struts-based web application.
Continue reading

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.
Continue reading

Author's picture

GreatWebGuy

Code jockey, cloud native enthusiast, technologist, car nut

Developer

West Palm Beach, FL