Re: Keep url parameters when posting

Splash Forums Rewrite Users Keep url parameters when posting Re: Keep url parameters when posting

#22818

detestable
Participant

@lincoln

I just added rewrite-integration-faces and it looks like it is working! Awesome!

I’m just getting some error randomly when submitting the form :

javax.servlet.ServletException: org.ocpsoft.rewrite.exception.RewriteException: El provider [org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider] could not inject property [#{segmentBean.identifier}} with value [[Ljava.lang.String;@7945c7e6]

root cause

org.ocpsoft.rewrite.exception.RewriteException: El provider [org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider] could not inject property [#{segmentBean.identifier}} with value [[Ljava.lang.String;@7945c7e6]

root cause

java.lang.IllegalArgumentException: FacesContext.getCurrentInstance() returned null. EL expressions can only be evaluated in the JSF lifecycle. You should use PhaseAction and PhaseBinding to perform an deferred operation instead.

I’m still using the same rewrite rules from my first post.

@Christian

When I use the rule you wrote segmentBean.identifier remains empty.

Just in case :

SegmentBean.java :

import javax.inject.Inject;
import javax.inject.Named;

@Named
@RequestScoped
public class SegmentBean {

private String identifier;

public String getIdentifier() {
return identifier;
}

public void setIdentifier(String identifier) {
this.identifier = identifier;
}
}

pom.xml :

<properties>
<opcsoft.rewrite.version>1.0.5.Final</opcsoft.rewrite.version>
</properties>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-servlet</artifactId>
<version>${opcsoft.rewrite.version}</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-integration-cdi</artifactId>
<version>${opcsoft.rewrite.version}</version>
</dependency>
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-integration-faces</artifactId>
<version>${opcsoft.rewrite.version}</version>
</dependency>

Am I doing something wrong?