-1

I am new to JSF and ADF technology.

I have a page index.jspx which gets loaded when the application starts. The page has a submit button.This page displays a hello message which I am setting in the managed bean DemoBean.

What I want is when the user clicks the submit button, the request will be forwarded to another page which is called welcome.jspx and the same msg gets displayed

pnuts
  • 58,317
  • 11
  • 87
  • 139
Shantanu
  • 201
  • 2
  • 6
  • 15
  • 1
    There are several good introductions on JSF. A 'summary' (and other interesting things) by BalusC can be found at https://jsf.zeef.com/ Please check those out. – Kukeltje May 04 '15 at 07:36

2 Answers2

1

You should read about JSF Page Navigation.

Anymore something like this should works for you:

YourBean.java

@ManagedBean
@SessionScoped
public class YourBean implements Serializable {

    private static final long serialVersionUID = 1L;

    private String name;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
}

index.xhtml

<h:form>
   <h:inputText value="#{yourBean.name}"></h:inputText>
   <h:commandButton value="Join" action="welcome"></h:commandButton>
</h:form>

welcome.xhtml

<h2>Welcome #{yourBean.name}!</h2>

In any case I suggest you to send the parameter in a request if you don't need Session.

See more:

antoniodvr
  • 1,259
  • 1
  • 14
  • 15
0

Shantanu

You should go through ADF Basics before starting , read some oracle docs, refer a good book and blogs

No need to use any HTML page or anything Just drop two pages in adfc-config.xml (default un-bounded taskFlow) and put a control flow between them .

Then in Action property of button refer that controlFlow name , this will navigate to second page on click of button

Once check - http://docs.oracle.com/cd/E23943_01/web.1111/b31974/taskflows.htm

Also go through- http://www.awasthiashish.com/2014/01/how-to-learn-oracle-adf-from-scratch.html