Java 5 compatibility
Tagged: Java 5
September 27, 2010 at 1:17 pm #17784
Unfortunately, I’m still stuck with Java 5 but would still like to use the excellent Pretty Faces library. The current version (3.1.0) seems to use new classes from the Java 6 stack so that I cannot use that version. Version 2.0.4, however, seems to come close to Java 5 compatibility.
As far as I have tested (view mapping plus query parameter mapping), there are two classes that use String.isEmpty(), which is not available on Java 6. When I copied and adjusted these classes (ParameterInjector, QueryParameter) I could get my required functionality to work!
My question is: Would it be possible to create an official version 2.0.5 that is compatible with Java 5? Means: Does the current code use more Java 6 functionality than just String.isEmpty() and would anyone be so kind to patch the old code base and create a new release?
I, at least, would appreciate this effort very much.
TimSeptember 27, 2010 at 2:06 pm #20182
Lincoln Baxter IIIKeymaster
Yikes! This is most certainly a mistake – we’ll fix this for version 3.1.1 ASAP. Thank you for letting us know!
–LincolnSeptember 27, 2010 at 2:25 pm #20183
Lincoln Baxter IIIKeymaster
Ok, this has been patched and committed. Check the latest snapshot of 3.1.1 (in the next 15 minutes) and let me know if it works.
I also found a few more isEmpty() calls in the PrettyFilter class, but I’m guessing that you are not using rewrite rules
–LincolnSeptember 28, 2010 at 7:22 am #20184
Thanks for your quick reaction! I just gave the snapshot a try but found that there are still dependencies on Java 6. The next error I got is in the class LazyBeanNameFinder that uses java.util.ServiceLoader, which is new in JDK 6. Hope you can sort this out.
TimSeptember 28, 2010 at 8:13 am #20185
ServiceLoaderis currently required, because it is used heavily for our annotation support. You could try to disable annotation support by setting this configuration parameter in
</context-param>September 28, 2010 at 8:18 am #20186
I just saw that there is a backport of the ServiceLoader API for JDK5. If everything else fails, you could try to use this one:September 28, 2010 at 8:54 am #20187
Oh sorry, ignore my last post. It seems like
backport-spiis using a different package name, so it won’t be a drop-in replacement for the JDK6 API.September 28, 2010 at 9:24 am #20188
Setting the context parameter to ignore the annotation support helps to circumvent the missing ServiceLoader class! However, there are still String.isEmpty() calls, for example in QueryParameter. My code is currently linked to the build prettyfaces-jsf2-3.1.1-20100927.143245-8.
Thanks a lot for your support,
TimSeptember 28, 2010 at 11:00 am #20189
Thank you for testing!
I’ve just removed some more occurrences of String.isEmpty() from the code. The new snapshots will be automatically deployed to the repository in about 15 minutes.September 28, 2010 at 11:55 am #20190
Thanks for fixing! With the new snapshot, the following configuration works as expected:
Links to my JSF test page are rendered correctly and on the test page, I can successfully query the mapped parameters. I did not test any other functionality, though.
Thanks again for your help! So when could we expect the new release 3.1.1?
TimSeptember 28, 2010 at 12:30 pm #20191
Great to hear that it is working for you. But unfortunately annotation support won’t be available for you. I don’t think that there is an easy way to replace
ServiceLocatorwithout writing our own.
Lincoln is doing the releases. I hope we can get it out soon!
You must be logged in to reply to this topic.