Well, currently I’m working on my project filesio, a platform for distributing large files via web interface instead of FTP.

One of the core abilities of my application is to provide widgets for third-party sites, allowing my users to include download-links to their files in their own web pages. These widgets are simple iframes that load content from my domain.

However, when implementing my app I struggled with the problem that Microsoft Internet Explorer per default blocks cookies set from within an iframe (of course, all other browsers don’t do this).

Lucklily, I found a really ..hm…interesting solution for this problem:

Read more…

For those of you who want to display a progress panel or a progress bar whenever some loading on your page is required, the JBoss Wiki contains a really good tip: RichFacesPleaseWaitBox.

This sample can be enhanced very easily to bring in some dynamic: within the rich:modalPanel, just use an animated gif, for instance from this cool page.

There are many scenarios where a web application must serve a file instead of a response containing HTML output to be rendered by the browser.

This little tip illustrates how to cause the browser to display a file download dialog instead of trying to display the data directly (which fails in most cases, especially with binary data).

As you will see, the whole magic concentrates on a special HTTP header, so this tip can be used with any technology and framework, ranging from Java Server Faces (JSF) and the Seam framework to PHP and even ASP or ASP.NET.

A common way to realize file download is to simply write the file data into the HTTP response.

However, if you have to handle arbitrary files, you are not able to set a specific Content-Type header like text/plain or something else.

So the client (namely the browser) has no idea what kind of data it actually receives and what to do with it.

Here is where the HTTP header Content-Disposition comes into play. Setting this header tells the client that an attachment is received and therefore causes the browser to display a file download dialog.
Now it’s the user’s responsibility to save the file and to open it with a corresponding application.

The Content-Disposition header consists of two values: the string “attachment” indicating an attachment and a “filename” property specifying a filename for the attachment. Usually, the browser takes this value as proposed filename in the download dialog.

The following line is an example extract from an HTTP response containing a Content-Disposition header:

Content-Disposition: attachment; filename="myFile.exe"

Recently I stumbled across a problem with the rich:modalPanel component of the JBoss RichFaces component library, which didn’t want to show the data of a backing been.

Let’s assume the following scenario:
You have a DataTable with several rows. Each row contains a “See details…” button. This button will popup a modal panel using rich:componentControl and the panel is populated with data of a backing bean. This backing bean is filled with actual data by clicking our “See details…” button using a4j:actionparam

Read more…

I think I have spent at least 5 hours to get a selectManyCheckbox working properly in JSF. I was getting validation errors and other trouble.

However I have found a great source of information. Also, on some other websites you can read that you should use an array instead of a List for the getter/setter of the backing bean.

Maybe this helps…

There are a lot of tips and hints out there on the internet, which describe how you could add support for Java Server Faces and Facelets to the Eclipse environment.
Mostly, they deal with adding code completion for JSF/Facelets tags and so on. There are some possibilities to achieve this, ranging from creating TLD files to using the JSP editor in Eclipse for the XHTML code of the Facelets pages.

But the “trick” I prefer is much more simple :D

You want to see it? Well, just download and install the JBoss Tools and you have it all!

Usually, when you enter standard <!-- ... --> html comments in your XHTML definition for a Facelets view, these comments are rendered by Facelets, so they are included in the resulting HTML. Even EL contained in these comments is executed!

In most cases, this is not what you hope to see, because if you want to make real comments, you have to use the <ui:remove> tag, which is not really comfortable.

Read more…

Recently I visited Jazoon, an international conference for Java developers at Zurich, Switzerland.

Having heard a lot of interesting talks, I want to sum up my impressions and try to figure out some of the latest trends in the world of Java as well as interesting facts for software architects.

This is part 3 of my series of blog posts and deals with

Ajax Push

Having worked with ICEfaces (but suspended work for now due to a lot of bugs), I was curious to hear a talk of one of the guys of ICEfaces, Ted Goddard.

The topic was Ajax Push. Surely, Ajax is a buzzword of today and everybody wants to have some Ajax functionality in his application, maybe just to be cool.

Read more…

This HowTo describes a way to integrate Seam, Spring and jBPM in order to use the same Hibernate SessionFactory in both Spring and jBPM (and of course, Seam).

At first, make sure you use the latest version 2.1.0 of Seam since you could get trouble with 2.0.1 and SpringTransactions.

The relevant parts of the configuration are:

Read more…