Java 5 compatibility

Splash Forums PrettyFaces Users Java 5 compatibility

Tagged: 

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

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

    welli
    Participant

    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.

    Thanks,

    Tim

    #20182

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

    –Lincoln

    #20183

    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.

    http://ocpsoft.com/repository/com/ocpsoft/prettyfaces-jsf2/3.1.1-SNAPSHOT/

    I also found a few more isEmpty() calls in the PrettyFilter class, but I’m guessing that you are not using rewrite rules :)

    –Lincoln

    #20184

    welli
    Participant

    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.

    Tim

    #20185

    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:

    <context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>none</param-value>
    </context-param>

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

    http://code.google.com/p/backport-spi/

    #20187

    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.

    #20188

    welli
    Participant

    Hi!

    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,

    Tim

    #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.

    #20190

    welli
    Participant

    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>

    <view-id>/test.jsf</view-id>

    </url-mapping>

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

    Tim

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

You must be logged in to reply to this topic.

Comments are closed.