webtier@glassfish.java.net

Re: Images, databases and jsf - how to make it work?

From: <forums_at_java.net>
Date: Thu, 9 Feb 2012 20:34:48 -0600 (CST)

  Really simple it isn't I'm afraid. You can start reading this to get a
handle on getting the data out of the
database: http://balusc.blogspot.com/2007/04/imageservlet.html [1]. Getting
the data into the database in the first place is probably an even bigger
nightmare.   You're going to need a component library like Richfaces and use
their rich:fileUpload. I have to say that I've never had any success using it
myself, I think because I use container security. The myfaces tomahawk
library has t:inputFileUpload which I have got working, although it has many
limitations, doesn't support ajax and has to be in a multipart/form-data
form. BalusC also has a file upload offering but I couldn't get that working
either at the time I tried it, but it might work for you (handy if you don't
want the baggage of a full component library for just one component).   I'd
strongly recommend allowing a lot of time to get this working. On a postitive
note Mojarra 2.2 is, I think, going to contain a file upload component which
is very good news because nobody else seems to be much good producing one
that works easily for everyone.   The various component library file upload
offerings (i.e. richfaces, primefaces etc...) typically either require you to
configure a filter in the web.xml or use an @WebFilter annotation in your
code. Especially if you are evaluating file upload components from different
providers, it's easy to end up with conflicting filter configuations, so keep
an eye on this. It's particularly easy to forget to comment out an @WebFilter
annotation that is no longer needed.

[1] http://balusc.blogspot.com/2007/04/imageservlet.html

--
[Message sent by forum member 'oversteer']
View Post: http://forums.java.net/node/883394