Java 5 compatibility

Splash Forums PrettyFaces Users Java 5 compatibility


This topic contains 10 replies, has 3 voices, and was last updated by  Christian Kaltepoth 11 years, 3 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #17784


    Hi there,

    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.




    Yikes! This is most certainly a mistake – we’ll fix this for version 3.1.1 ASAP. Thank you for letting us know!



    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 :)




    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.



    Hey Tim,

    unfortunately the ServiceLoader is currently required, because it is used heavily for our annotation support. You could try to disable annotation support by setting this configuration parameter in web.xml:



    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:


    Oh sorry, ignore my last post. It seems like backport-spi is using a different package name, so it won’t be a drop-in replacement for the JDK6 API.




    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,



    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.



    Thanks for fixing! With the new snapshot, the following configuration works as expected:

    <url-mapping id=”test”>

    <pattern value=”/test/#{urlPart:testBean.urlPart}”/>

    <query-param name=”param”>#{testBean.queryParam}</query-param>



    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? :-)



    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 ServiceLocator without writing our own.

    Lincoln is doing the releases. I hope we can get it out soon! :-)

Viewing 11 posts - 1 through 11 (of 11 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.