I'm new to the world of Java programming (but not programming) and I have jumped in with two feet all the way up to my neck in trying to solve a problem.
I have a JSF 2.2 page which is currently creating a link such as this:
/folder1/destination.jsf was performing some work and then jumping to /anotherfolder/destination2.jsf and losing the bean in the jump. I want to pass the bean over to the second page and thought using a JSF 2.2 FlowScoped bean would solve the problem.
I created the following FlowBuilder:
import java.io.Serializable;
import javax.enterprise.inject.Produces;
import javax.faces.flow.Flow;
import javax.faces.flow.builder.*;
public class MyPageJumpingFlow extends Object implements Serializable {
private static final long serialVersionUID = 1L;
@Produces
@FlowDefinition
public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder) {
String flowId = "MyPageJumpingFlow";
flowBuilder.id("", flowId);
flowBuilder.viewNode(flowId, "/folder1/destination.xhtml").markAsStartNode();
flowBuilder.viewNode(flowId+"2", "/anotherfolder/desintation2.xhtml");
return(flowBuilder.getFlow());
}
The backing bean for destination.jsf is instantiated this way:
@Named(value="destinationObject")
@FlowScoped("MyPageJumpingFlow")
My problem now is trying to understand how to start the flow and pass the parameters to it.
Any suggestions about how to do that or a better way to solve this problem would be appreciated.
Environment: JSF 2.2, Java EE 7, EclipseLink, Oracle Weblogic 12.1.3