Getting JavaScript CSS Dropdown Menu to Render Over a Flash Component

If you are having trouble getting a DHTML drop-down menu to display on top of a Flash movie try adding the following to the <object> tag that embeds the .swf file in your .html.

Add the following as a child to the <object> tag:

<param name=”wmode” value=”transparent” />

Add the following as an attribute to the <object> tag:

wmode=”transparent”

I was having trouble getting a JavaScript dropdown to render over a Flash movie under IE and after adding the aforementioned → Continue reading “Getting JavaScript CSS Dropdown Menu to Render Over a Flash Component”

Compiling .jsp Fragments in Eclipse

The ability to generate HTML or .JSP fragments that you can include on multiple pages of your site enables you to re-use code and increase maintainability.

However, if you need to include functions (or methods) and fields (or variables) in one fragment that is included on a page and then utilize them in another fragment included in the same page Eclipse will give you compile errors because it concludes that your references are out of scope.

The solution is quite → Continue reading “Compiling .jsp Fragments in Eclipse”

Accessing JSON Data Under IE7

Given the following JSON object:

var var_affectedAreas = {
? ? ‘areaCount’ : 6,
? ? ‘areasList’: [
? ? ? {‘enum’: ‘FILE’, ‘val’: ‘F’},
? ? ? {‘enum’: ‘REGISTRY’, ‘val’: ‘R’},
? ? ? {‘enum’: ‘PROCESS’, ‘val’: ‘P’},
? ? ? {‘enum’: ‘MEMORY’, ‘val’: ‘M’},
? ? ? {‘enum’: ‘NETWORK’, ‘val’: ‘N’},
? ? ? {‘enum’: ‘OTHER’, ‘val’: ‘O’}
? ? ]
};

You would think (and rightly so, at least under Firefox) that you would be able to → Continue reading “Accessing JSON Data Under IE7”

Setting up Cygwin, Linux Command Line, on a Windows Box

For all of you Linux (and Unix) users who are used to the Linux command line there is an application called Cygwin. Not only does it allow you to use the familiar command line commands but it also includes the ability to execute bash and csh shell scripts on a Windows machine.

When installing it, here are a few additional packages you’ll probably want to include:

vim, ncurses, tcsh

Simply type them into the search field and then check off → Continue reading “Setting up Cygwin, Linux Command Line, on a Windows Box”

Applying Order to JSON Data When Rendering to a Page

It is very convenient to pass JSON data from client to server and between different server-side components. However, JSON data is an inherently unordered data structure and in many cases a developer will want to render a list of items in some specified order.

One way that I found to do so is to append an integer to the keys in your data when generating the JSON data. For example, you might be iterating through a database result set and → Continue reading “Applying Order to JSON Data When Rendering to a Page”

Opening a New Window From a Web Page with Javascript that is SEO Friendly

The days of <a href=”#” target=”_blank”></a> are long gone. The way to open a new window with a link is to do it using the javascript window.open() method via an onclick callback.

However, you still want to make your pages SEO friendly, so you don’t want to go about generating links with href=”#”. The way to do it is as follows:

Javascript:

<script>

function openNewWindow(url) {

   window.open(url);

}

</script>

HTML:

<a href=”someURL.html” onclick=”openNewWindow(‘someUrl.html’);return false;”>Link</a>

When implementing links this way, → Continue reading “Opening a New Window From a Web Page with Javascript that is SEO Friendly”

Using bash Shell to Rename Files With Spaces

The following is a shell command that you can use to rename any file that contains spaces. Without the quotes surrounding the $file reference and the echo command it will fail.

In this example, we rename anything that is .htm to .html

for file in *.htm ; do mv “$file” “`echo “$file” | sed ‘s/\(.*\.\)htm/\1html/’`” ; doneContinue reading “Using bash Shell to Rename Files With Spaces”

java.lang.reflect.UndeclaredThrowableException When Attempting to Invoke a Remote Method on an EJB Singleton Instance

I am building an EJB Singleton that generates and maintains data that I want accessible to multple clients. Since the data is not based on any client interaction but based on the status of a single server-side application I went with an EJB Singleton.

When attempting to invoke a method via the Remote interface on the bean instance from a servlet in a separate .war which was returning a LinkedList of a custom Object that I wrote, I was getting → Continue reading “java.lang.reflect.UndeclaredThrowableException When Attempting to Invoke a Remote Method on an EJB Singleton Instance”

Updating the URL of a Subversion Repository in a Currently Checked Out Copy of Your Repository

Let’s say you have a server who’s IP address or domain name changes on which you have a Subversion repository. Furthermore, you have checked out the copy over an ssh connection using svn+ssh.

If you have checked-out copies of your repo, and the path to the repo on the file system hasn’t changed, but only the IP or domain name has changed you need to issue the following command in the root of your checked out copy:

svn switch –relocate Continue reading “Updating the URL of a Subversion Repository in a Currently Checked Out Copy of Your Repository”