Challenge Engineer Life !

エンジニア人生を楽しみたい!仕事や趣味で学んだ技術的なことを書いていくブログです。

PrimeFaces FileUpload component doen't work on Embedded Glassfish.

Now, I'm developing offline web system after finishing developing online web.

I had experience once. I wrote following posts about how I developed offline web before.But these are Japanese.

kikutaro777.hatenablog.com
kikutaro777.hatenablog.com

This time, I found some strange behavior.

In this system, we use PrimeFaces FileUpload component. The version of PrimeFaces is 5.2. Of course it works fine on GlassFish.

But, unfortunately, it doesn't work on Embedded GlsasFish :q

I don't understand what happened inside and what is different between GlassFish and Embedded GlassFish.

I checked the document of PrimeFaces. Really appreciate the good document.

http://www.primefaces.org/documentation

The document explained there are three options for FileUpload component.
auto / native / commons.

The default mode is auto.

PrimeFaces tries to detect the best method by checking the
runtime environment, if JSF runtime is at least 2.2 native uploader is selected, otherwise commons.

I tried to use the option "native", but nothing changed.
After that, I tried "commons".

Finally, it worked on Embedded Glassfish !!!

The explanation of the document about "Commons" is following.

This option chooses commons fileupload regardless of the environment, advantage of
this option is that it works even on a Servlet 2.5 environment.

I still don't understand what happened inside... anyway, it's good for us now.

にほんブログ村 IT技術ブログへ
にほんブログ村 にほんブログ村 IT技術ブログ Javaへ
にほんブログ村