Cant get EL.property to work

Splash Forums Rewrite Users Cant get EL.property to work

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

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #18479

    Vivek Katta
    Participant

    Hi, just started using rewrite. Its a great framework! but am not able to set the URL segments into a bean using EL.

    The rule I am using:

    addRule(Join.path("/{betaName}/{profileURI}").where("betaName").bindsTo(El.property("#{navigationBean.betaName}")).constrainedBy(betaNameConstraint) .to("/faces/view/commons/protected-profile-access.xhtml").when(notLoggedInCondition))

    The rule is working the way I want but navigationBean.betaName remains null. Am I missing something? Is the rule usage correct?

    Any help appreciated.

    thanks,

    PS. All necessary dependencies have been included

    #22740

    Hi,

    could you tell us more about the navigationBean? Is it a CDI managed bean? Which scope does it have?

    Thanks

    Christian

    #22741

    Vivek Katta
    Participant

    Hi Christian, it is a CDI bean and I tried both conversation scope (not long running) and session scoped.

    My Environment:

    I have included the rewrite-integration-cdi jar as well. Its a JSF2, RF 4 application running on jboss as 7.1. I have seam solder configured as well which caused a problem with ExpressionFactoryProducer class complaining of ambiguity. I then deleted this class from the seam solder jar(temp fix) and the application started up correctly.

    Let me know if you need more information.

    Thanks,

    Vivek

    #22742

    Ok, it sounds like we need to add some qualifiers to the Rewrite EL integration module.

    #22743

    Which version of Rewrite are you using? If I remember correctly, the issue regarding ExpressionFactoryProducer was fixed some time ago.

    #22744

    Vivek Katta
    Participant

    I am using 1.0.5.Final which I thought was the latest version

    #22745

    Vivek Katta
    Participant

    Also, I wasn’t very clear about the difference between addRule and defineRule…is one better than the other?

    Thanks,

    Vivek

    #22746

    addRule() adds a rule object, whereas defineRule() lets you build one using conditions and operations. They should probbly both be addRule

    #22747

    Vivek Katta
    Participant

    Hi, need some advise on ExpressionFactoryProducer. How do I solve that problem? I am using seam solder 3.0.Final.

    Thanks,

    Vivek

    #22748

    Hmmm… in order to fix this properly, I need some more info.

    What is the exact error you get?

    Could you upload a simple maven war project that reproduces this?

    Thanks!

    #22749

    Vivek Katta
    Participant

    Sure..I’ll upload one soon.

    #22750

    Awesome! Thanks :)

    #22751

    Vivek Katta
    Participant

    Hi Lincoln, can’t seem to find a way to upload files (or have I missed something trivial here?)

    Anyway I am pasting the stacktrace here. The project was an empty web app with seam solder and rewrite included. Also I had a @Startup class configured where I had one log statement (logger implemented using Jboss message logger and hence seam solder)

    Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [ExpressionFactory] with qualifiers [@Default] at injection point
    [[parameter 2] of [constructor] @Inject public org.jboss.seam.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ExpressionFactory] with qualifiers [@Any @Default]
    declared as [[method] @Produces @ApplicationScoped org.ocpsoft.rewrite.cdi.expressions.ExpressionFactoryProducer.createExpressionFactory(BeanManager)], Producer Method [ExpressionFactory] with qualifiers [@Any @Default]
    declared as method] @Produces @ApplicationScoped org.jboss.seam.solder.el.ExpressionFactoryProducer.createExpressionFactory(BeanManager)]

    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:278)
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:107)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:127)
    at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:346)

    Hope this helps..

    Thanks,

    Vivek

    #22752

    Ok, as I suspected, this looks like a bug in Solder, but we can work around it by renaming some classes and removing some extensability (we really don’t need to be extensible in the same way Solder does.)

    #22753

    Also, you’re right. It seems that our file-upload plugin has stopped working. I’ll take a look into that… that’s bad :)

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.

Comments are closed.