Site Network: Personal | Professional | Photography

Technical Blog

This blog will contain content related to Java, Seam, Security, my sites and projects, as well as other technical subjects I am interested in.

Comments and questions are welcome!

Firefox, xhtml, JBoss 4.2.0, JSF, and Google Ads

Sunday, June 10th, 2007

I upgraded the JBoss instance on my server just over a week ago from 4.0.5 to 4.2.0. Two things happened after that: Firstly, my google adsense revenue dropped by half, secondly I was contacted by two different people who were having some e-mails show a big error in Firefox, instead of showing up correctly. I don't use Firefox myself, I use Safari about 98% of the time and Camino when I find a site that doesn't render correctly in Safari. Today I discovered, while working on a new ad layout, that in Firefox the Google ads weren't rendering at all, throwing this error in the Firefox error console:

Error: uncaught exception: [Exception... "Object cannot be created in this context" code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)" location: "http://pagead2.googlesyndication.com/pagead/show_ads.js Line: 4"]

Basically iframes can't be programatically inserted into strict xhtml elements. I did some googling and discovered that there were some discussions around this, but most of them simply said "either ditch google ads, or use text/html instead." But I WAS using text/html, both in the meta content tag in the pages, and then later (while working on this issue) in the JBossWeb web.xml mime type configuration for xhtml, just in case. Using wget with --save-headers didn't show anything unexpected. However, Firefox kept getting the response header saying the page was application/xhtml+xml which caused it to perform very strict validation, both breaking the google ads, and not letting sloppy tags or duplicated tags into the page, which are inherently going to happen when you're rendering html e-mail within a page.

The cause of the break was not moving to JBossWeb in 4.2.0, nor any JBoss code itself. It turns out that when the JSF implementation was changed from MyFaces to Sun's JSF-RI as part of the JBoss and Seam upgrade I did, the default content mime type changed as well. JSF-RI sets it to application/xhtml+xml. The fix was simple, add the following tag just before the <head> tag in each .xhtml faclets page:

<f:view contentType="text/html"/>

Web Services and Seam

Monday, April 9th, 2007

Let's say you have a Seam application, and you need to create some web services that tie in to it, or you are building a web service and you would like to take advantage of the Seam component model, lifecycle management, etc...

How do you expose Seam functionality through web services? Let's dive into it:

(more...)

10MinuteMail.com hit digg.com’s front page last night

Sunday, November 26th, 2006

It's filtered down a few pages off the front, but hey, front page of digg.com! Wow! Totally grassroots in about 4 hours. Now it's on all kinds of little blogs and tech forums and other odd places. Over 100k hits in the last 18 hours. It performs very well. There's very little cpu hit at all. Go SEAM!

Anyhow, I'm proud. Check it out and let me know what you think!

Digg.com:
"A disposible email service...You can read them, click on links, and even reply to them. The e-mail address will expire after 10 minutes."

read more | digg story

Index page issues when putting JBoss behind Apache

Wednesday, November 8th, 2006

So, if you're using Seam, you usually have xhtml files which represent the pages, and then the Seam servlet takes care of rendering them. When I setup my latest project, I changed the web.xml to switch from using page.seam to page.html, to mask the back-end technology. When I did this, I also deleted the seemly unnecessary index.html that was sitting in my view directory. I then added this into my web.xml, just to be on the safe side:

	&lt;welcome-file-list&gt;
		&lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
	&lt;/welcome-file-list&gt;

(more...)

My first Seam Application - 10MinuteMail

Sunday, November 5th, 2006

My first web application built using Seam is now live. It is called 10MinuteMail and you can see it at www.10MinuteMail.com.

It gives you a temporary e-mail address, and lets you receive and reply to e-mail sent to that address. The e-mail address expires in 10 minutes (or more, you can extend it as you need more time). Basically I created to learn Seam, and to provide an easy way to avoid giving your real e-mail address to websites which require an e-mail from you to sign-up. Think of it as spam avoidance.