4 Replies Latest reply on Nov 9, 2012 1:44 AM by Subramanian Meyyappan

    Page Flow Problem


      Im new for jdeveloper. Im ORAforms pl/sql programmer and no deep knowledge about java.

      Im following the sample on https://blogs.oracle.com/shay/entry/for_some_reason_one_common.

      Im trying this sample as forms manage security and before im diving deep to jdeveloper i need to study basic for this new IDE & framework{managed beans,biding..etc}.

      And built it in scratch but i cannot make it navigate to another page after click the button heres the code i dont know how to explain much because im new maybe sharing the code would help.

      My work not complete yet as when password not correct. just want first to navigate the welcome page when return value is GOOD.
      Only need also when return value is BAD just display dialog or error message.

      How to bind the manage bean?

      VERSION : Studio Edition Version
      <?xml version='1.0' encoding='UTF-8'?>
      <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
          <jsp:directive.page contentType="text/html;charset=UTF-8"/>
              <af:document title="LogInPage.jspx" id="d1">
                  <af:form id="f1">
                      <af:panelStretchLayout topHeight="90px" startWidth="100px" id="psl1">
                          <f:facet name="top">
                              <af:panelStretchLayout id="psl4" startWidth="526px" endWidth="326px" topHeight="5px"
                                  <f:facet name="bottom"/>
                                  <f:facet name="center"/>
                                  <f:facet name="start">
                                      <af:image source="/images/njc_banner.PNG" id="i1"/>
                                  <f:facet name="end"/>
                                  <f:facet name="top"/>
                          <f:facet name="center">
                              <!-- id="af_twocol_left_full_header_Stretched"   -->
                              <af:decorativeBox theme="dark" id="db2">
                                  <f:facet name="center">
                                      <af:panelStretchLayout startWidth="334px" id="psl2">
                                          <f:facet name="center">
                                              <af:decorativeBox theme="medium" id="db1">
                                                  <f:facet name="center"/>
                                          <f:facet name="start">
                                              <af:decorativeBox id="db3" theme="medium" dimensionsFrom="parent">
                                                  <f:facet name="center">
                                                      <af:panelFormLayout id="pfl1" inlineStyle="height:365px;">
                                                          <f:facet name="footer">
                                                              <af:panelBorderLayout id="pbl1"
                                                                                    inlineStyle="width:275px; height:27px;">
                                                                  <f:facet name="start">
                                                                      <af:group id="g1">
                                                                          <af:panelBorderLayout id="pbl2"
                                                                                                inlineStyle="height:173px; width:219px;">
                                                                              <f:facet name="right">
                                                                                  <af:group id="g3">
                                                                                      <af:spacer width="38" height="16"
                                                                                      <af:group id="g2">
                                                                                          <af:commandButton text="Log In"
                                                          <af:spacer width="179" height="65" id="s1"/>
                                                          <af:inputText label="Username" id="it1" showRequired="true"
                                                                        requiredMessageDetail="Please Enter Your Username"
                                                                        autoSubmit="true" autoComplete="on" required="true"/>
                                                          <af:inputText label="Password" id="it2" secret="true"
                                                                        requiredMessageDetail="Please Enter Your Password"
                                                                        autoSubmit="true" required="true"/>
                                                  <f:facet name="top"/>
      My Managed Bean
      package njchis;

      import oracle.adf.view.rich.component.rich.input.RichInputFile;
      import oracle.adf.view.rich.component.rich.input.RichInputText;
      import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
      import java.sql.*;
      import oracle.jdbc.OracleDriver;

      public class GetUserName {
          private RichInputText it1;
          private RichInputText it2;
          private RichCommandButton cb1;

          public void setIt1(RichInputText it1) {
              this.it1 = it1;

          public RichInputText getIt1() {
              return it1;

          public void setIt2(RichInputText it2) {
              this.it2 = it2;

          public RichInputText getIt2() {
              return it2;

          public void setCb1(RichCommandButton cb1) {
              this.cb1 = cb1;

          public RichCommandButton getCb1() {
              return cb1;
          public String login_action() {
              // Add event code here...
              String user = this.getIt1().getValue().toString();
              String pass = this.getIt2().getValue().toString();
              Connection conn;

              try {
                  conn = getConnection();
                  Statement stmt = conn.createStatement();
                  ResultSet rset = stmt.executeQuery ("SELECT 'x' FROM itdept.OFFICE_USERS where OFFICE_EMP_NO = '"+user+"' and OFFICE_PASS = '"+pass+"'");
                  if (rset.next())  {
                         return "good";                       
              } catch (SQLException e) {
              return "bad";


          public static Connection getConnection() throws SQLException {
              String username = "itdept";
              String password = "itdept";
              String thinConn = "jdbc:oracle:thin:@";
              DriverManager.registerDriver(new OracleDriver());
              Connection conn =
                  DriverManager.getConnection(thinConn, username, password);
              return conn;
      <?xml version="1.0" encoding="windows-1252"?>
      <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee">
      Edited by: ck on Nov 8, 2012 1:31 AM