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!

JBoss Tools Properties Editor Surprise

Sunday, August 19th, 2007

No, not the kind of surprise with cake.

The latest JBoss Tools Eclipse plugin, which if like me you are running on a platform that they haven't released RedHat Developer Studio for is a pretty good option, which can be installed through Eclipse using this update URL:

http://download.jboss.org/jbosstools/updates/development

Sets up your default editor of .properties files to be the new Red Hat Properties Editor. It looks very snazzy. However, at least on my machine (Eclipse 3.3, JDK 1.5, OS X 10.4.10), whenever it opens a properties file, it happily strips out all of the equals signs separating property names from their values. They still look good in the graphical portion of the Red Hat Editor, but of course don't work very well anywhere else.

You can fix this by going into the Eclipse Preferences, General, Editors, File Associations, scrolling down until you see the "*.properties" entry and choosing the "Properties File Editor" as your default.

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"/>

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...)

JBoss Seam

Sunday, November 5th, 2006

JBoss has recently released version 1.1 beta of the Seam product.

As JBoss puts it, Seam is:

JBoss Seam is a powerful new application framework to build next generation Web 2.0 applications by unifying and integrating popular service oriented architecture (SOA) technologies like Asynchronous JavaScript and XML(AJAX), Java Server Faces(JSF), Enterprise Java Beans(EJB3), Java Portlets and Business Process Management(BPM) and workflow.

(more...)