NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

File Upload with JSF 2.0

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
tony bonn



Joined: 27 Nov 2010
Posts: 4

PostPosted: Sat Nov 27, 2010 8:07 pm    Post subject: File Upload with JSF 2.0 Reply with quote

i have read the nb 6.5 tutorial on how to add file upload capabilities in jsf for such types as images using the upload file component in the visual development tool. however i do not see anything comparable related to 6.9.1 since the visual developer has been removed. is there a file upload component available for 6.91? if so, how do i find, install, and configure for use?

it needs to be useable with glassfish v3. if there is nothing available does anyone know if the tomahawk libraries which includes a fileupload component of sorts works with nb/glassfish?
Back to top
mdeggers



Joined: 28 Jan 2009
Posts: 208

PostPosted: Sun Nov 28, 2010 8:55 am    Post subject: File Upload with JSF 2.0 Reply with quote

If you're using 6.8, 6.9.1, or possibly 7.0beta (haven'd downloaded that
yet), you could take a look at PrimeFaces (http://primefaces.org).

There's a FileUpload component listed in the user's guide.

Integration with NetBeans is discussed on several web pages:

http://wiki.netbeans.org/DevelopAjaxJSF2App
http://weblogs.java.net/blog/cayhorstmann/archive/2010/09/13/primefaces-works-great-jsf-20netbeans-69

It's on my list of things to try.

. . . . just my two cents.

/mde/
Back to top
tony bonn



Joined: 27 Nov 2010
Posts: 4

PostPosted: Sun Nov 28, 2010 9:36 am    Post subject: thank you Reply with quote

that was a good tip. i have spent the last 12 hours trying to get tomahawk/myfaces/apache commons installed without success but the setup on primefaces is too easy and it has a file upload component which installed quickly (although i have not been able to confirm that it actually works.) i just need to track down what it did with my file and confirm that i can save retrieve the file.

those other libraries not only would not install but required inumerable steps and much futile debugging. i can do a low grade happy dance. thank you.

for those downloading primefaces select the bundle since the binary file contains no jar. i wouldn't know how to build a jar file from the source and have enough to do washing the dishes without having to dry them...
Back to top
pepelara



Joined: 29 Nov 2008
Posts: 115

PostPosted: Tue Nov 30, 2010 12:15 pm    Post subject: Re: File Upload with JSF 2.0 Reply with quote

Hi,

Take a look at this blog,

http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html

I have tried it and it works ok.

--------------------------------------------------
From: "tony bonn" <address-removed>
Sent: Saturday, November 27, 2010 9:07 PM
To: <address-removed>
Subject: [nbj2ee] File Upload with JSF 2.0

Quote:
i have read the nb 6.5 tutorial on how to add file upload capabilities in
jsf for such types as images using the upload file component in the visual
development tool. however i do not see anything comparable related to
6.9.1 since the visual developer has been removed. is there a file upload
component available for 6.91? if so, how do i find, install, and configure
for use?




Back to top
tony bonn



Joined: 27 Nov 2010
Posts: 4

PostPosted: Tue Nov 30, 2010 6:53 pm    Post subject: Reply with quote

yes i saw that blog and it's way too busy and way too much work although i have only the highest regard for balusc. the primefaces component is the appropriate solution - it's extremely simple and clean. besides, i could not get myfaces/tomahawk to work.

i will warn folks who are running mojarra 2.0.2 that they will need to upgrade to 2.0.3 if they want primefaces' component (2.0.2rc2) to work as advertised. otherwise they will need to use balusc's phaselistener routine which has certain distinct disadvantages such as loss of ajax updates to the jsf.
Back to top
Tony
Posted via mailing list.





PostPosted: Wed Dec 01, 2010 5:06 pm    Post subject: Re: File Upload with JSF 2.0 Reply with quote

Tony

Does that upgrade solve the issue of the Save state not propagating because
it can't serialise an Object?

Tony

-----Original Message-----
From: tony bonn [mailto:address-removed]
Sent: 30 November 2010 18:54
To: address-removed
Subject: [nbj2ee] File Upload with JSF 2.0

yes i saw that blog and it's way too busy and way too much work although i
have only the highest regard for balusc. the primefaces component is the
appropriate solution - it's extremely simple and clean. besides, i could not
get myfaces/tomahawk to work.

i will warn folks who are running mojarra 2.0.2 that they will need to
upgrade to 2.0.3 if they want primefaces' component (2.0.2rc2) to work as
advertised. otherwise they will need to use balusc's phaselistener routine
which has certain distinct disadvantages such as loss of ajax updates to the
jsf.
Back to top
tony bonn



Joined: 27 Nov 2010
Posts: 4

PostPosted: Wed Dec 01, 2010 7:39 pm    Post subject: mojarra upgrade Reply with quote

i can only state that i was experiencing a viewstate error. i am not much of a j2ee programmer so my explanation of the problem is rather sketchy. but i will state that what i encountered was not a primefaces issue. it was actually a jsf issue.

i thought initially that my viewstate errors were due to primeface controls because i encountered the problem after installing its components. however the condition was pre-existing and unfortunately even the pf folks are not clued in to the situation as they all claim they werent' having the problem that many of its clients were reporting. i'll not vent my contempt for that kind of response.

the viewstate errors could be encountered with jpa driven controls which was my experience. the solution was to upgrade. i think that i am still seeing serialize object errors/warnings but they do not impede navigation as was the case prior to the upgrade.

however, as with all things java, you have to have a perfect alignment of the galaxy to know if upgrading would work for you....someone else on the pf forums confirmed that it solved his problems also. but keep in mind this is a jsf issue - not pf or jpa.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo