aspose file tools
The moose likes JSF and the fly likes  Adding jar files to an old JSF project Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark " Adding jar files to an old JSF project" Watch " Adding jar files to an old JSF project" New topic
Author

Adding jar files to an old JSF project

Christopher Sharp
Ranch Hand

Joined: Dec 12, 2007
Posts: 139
For the first time in 4 years I'm trying to resurrect an old JSF project. It was created without an IDE using a console in Linux. I've since installed Eclipse Indigo release 2, which I'm using on a Windows Vista computer, and works correctly with simple Java projects.

I'm now trying to get this old JSF project working with Eclipse before I change it, but I'm having problems with some jar files. The old code imported the class org.apache.myfaces.custom.fileupload.UploadedFile. The associated jar file is commons-fileupload-1.1.jar. There are three other jar files that may be required, but after 4 years I can't remember. They are commons-el.1.0.jar, commons-io.1.2.jar and commons-logging-1.1.1.jar.

I copied the first file to WebContent/WEB-INF/lib/ then configured the build path to include it, but the class using UploadedFile does not recognize it. I did the same with the other three files, but that is still the case. What has to be done to get UploadedFile working?

The three other classes in the project do not use UploadedFile, and look OK so far. Incidentally, the old project used JSF 1.2, but I'm now using JSF 2.0, and wonder if that may be part of the problem.

Advice and help would be most appreciated.

csharp
Eric Graham
Greenhorn

Joined: Sep 13, 2012
Posts: 5

Download the approperate files/jars to, say, MyDocuments. Then in Eclipse, right click your project in Project Explorer, click Build Path -> Config Build Path, Add External Jars. Should work. Update Eclipse, make sure you have all the proper jars (updated versions), veiw build path and make sure it imports into the project. That "should" be that...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14460
    
    7

You're making a good case for using Maven. Maven excels at gathering together old stuff and making it work long after it's no longer cutting-edge.

I don't think moving to JSF2 is that much of a problem, but I have reservations about the commons-el jar. Several years back, the Tomcat webapp container didn't have built-in EL support and you had to include your own. As of Tomcat 6, the Unifed EL is part of Tomcat itself and any app-supplied EL implementation would have to be removed.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Adding jar files to an old JSF project
 
Similar Threads
Trying to add string values to a list or some type of collection through iterator
Sharing the Eclipse .classpath File
File upload
rich:tree working now... all the work has finally paid off - THANKS
Heeelp! Fileupload with jsf and ajax