How to use EL bind of urlrewrite

Splash Forums Rewrite Users How to use EL bind of urlrewrite

This topic contains 12 replies, has 3 voices, and was last updated by  dolphincn 5 years, 4 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #18141

    dolphincn
    Participant

    I used jsf 2.1 and rurlewrite 1.0 snapshot.

    I add a rule,

    .addRule(

    Join.path(“/admin/category/{categoryBean.type}”)

    .where(“categoryBean.type”).bindsTo(El.property(“#{categoryBean.type}”))

    .matches(“(menu|product|article)”)

    .to(“/web/admin/category/category_list.xhtml”)

    )

    but output following error:

    Jan 28, 2012 2:28:26 PM com.ocpsoft.rewrite.bind.El

    WARNING: No instances of [com.ocpsoft.rewrite.spi.ExpressionLanguageProvider] were configured. EL support is disabled.

    #22033

    Could you post the dependencies you added to your project. I guess you are missing a maven dependency that includes a ExpressionLanguageProvider. Are you using CDI, Spring or plain JSF?

    #22034

    dolphincn
    Participant

    I used netbeans 7.1 and tomcat 7.1, so I didn’t use CDI and spring,just plain jsf.

    the lib inlucde:rewrite-servlet.jar,jsf 2.1 dependencies. no other jar.

    #22035

    dolphincn
    Participant

    I found “rewrite-integration-cdi” has the function, but the lib need jboss lib.

    I don’t want to add jboss lib.

    #22036

    As far as I can see there are currently only ExpressionLanguageProvider implementations for CDI and Spring.

    @lincoln: What about adding an ExpressionLanguageProvider for JSF. I think this would make sense, doesn’t it?

    @dolphincn: Just a side node from me. If you start a new project you should really don’t use only plain JSF for it. Adding CDI or Spring to you project to manage your beans totally makes sense.

    #22037

    dolphincn
    Participant

    Thank Christian Kaltepoth. My project doesn’t need CDI and Spring.

    #22038

    Yes, right now the only options are cdi or spring. The only jboss dependency is solder.

    We can add plain jsf support, but its not there yet. It wasnt implemented because I dont recommend using plain jsf beans. Its of course your choice though :) but the jsf bean container is deprecated.

    #22039

    Perhaps we should note that of cause you could implement your own ExpressionLanguageProvider for JSF. This should be very easy as you can get everything you need from the FacesContext. Then just register your implementation like described here:

    http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html

    Let us know if you need any further information! :)

    #22040

    dolphincn
    Participant

    Thank Lincoln and Christian.

    #22041

    dolphincn
    Participant

    I found there have a solution about set parameter value to managedbean property of jsf via set.

    http://kenai.com/projects/scales/pages/PrettyUrlPhaseListener

    #22042

    If you want to do this, just use PrettyFaces…

    http://ocpsoft.com/prettyfaces/

    PrettyUrlPhaseListener is not a very complete solution, your original URLs will be exposed in rendered page HTML and forms, redirects will not display the correct location either.

    #22043
    #22044

    dolphincn
    Participant

    Thank you very much.

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

You must be logged in to reply to this topic.

Comments are closed.