Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

ADF Login page

Jana SawalhiJan 26 2024

how can I create a login page and bind it with an appropriate managed bean for logging, I am building an ADF app, I am connected to the HR database schema

this is what i am supposed to do, I built the pages but here's what I have on my mind:

I add the managed bean, generates class automatically, add parameters and accessors and login method as following

     public String login() {
            // Implement your login logic here
            if (username.equals("validUsername") && password.equals("validPassword")) {
                return "success"; // Navigation outcome
            } else {
                // Display error message
                FacesMessage message = new FacesMessage("Invalid username or password");
                FacesContext.getCurrentInstance().addMessage(null, message);
                return null;
            }

and then edit the page values and all like this

but I am not sure what is the right thing to do next, or if I am not building it right

and if using a router like this will make it better

Comments
Post Details
Added on Jan 26 2024
2 comments
92 views