Reply To: @Parameter and null-values

Splash Forums Rewrite Users @Parameter and null-values Reply To: @Parameter and null-values

#25631

Hey Reinhard,

I just had a quick look at your app. The reason why your configuration doesn’t work with 2.0.9.Final is that you are not binding the parameter correctly to the bean property. If you use the ConfigurationProvider API, you have to configure the join like this:

.addRule(
   Join.path("/customer/{customerId}")
      .to("/faces/customer.xhtml")
)
.where("customerId").bindsTo(
   El.property("customerBean.customerId")
)

The reason why it worked with 2.0.8.Final was actually a bug in the annotation processing code. You had a class like this:

public class CustomerBean implements Serializable {

  @Parameter("customerId")
  private String customerId;

}

Please note that there are no other Rewrite annotations on the class itself.

Unfortunately Rewrite 2.0.8.Final created a rule from the class that looked like this:

.addRule()
.when(new True())
.where("customerId").bindsTo(
   El.property("customerBean.customerId")
)

This rule will try to bind the parameter for EVERY request received by the container, which is of cause not a very good idea. In your case it had a positive effect, because this rule added the binding you forgot when declaring the join. 🙂