0 Replies Latest reply on Apr 16, 2018 1:29 AM by 954736

    R12.2.6 Jsp Call OAPAGEHOME Result Waiting

    954736

      On R12.2.6,Customer tried Jsp page call OAPAGEHOME to automatically login,but the status is waiting.

      It is ok on R12.1.3.

       

      Please provide any suggestion and I attached the jsp script.

       

      <%@ page language="java" contentType="text/html;charset=UTF-8"%>

      <%@ page import="java.sql.Connection"%>

      <%@ page import="oracle.apps.fnd.common.ProfileStore"%>

      <%@ page import="oracle.apps.fnd.common.WebAppsContext"%>

      <%@ page import="oracle.apps.fnd.common.Log"%>

      <%@ page import="oracle.apps.fnd.sso.Utils"%>

      <%@ page import="oracle.apps.fnd.sso.SessionMgr"%>

      <%@ page import="oracle.apps.fnd.i18n.util.*"%>

      <%@ page import="oracle.apps.fnd.security.*"%>

      <%@ page import="java.sql.PreparedStatement"%>

      <%@ page import="java.sql.*"%>

      <%@ page import="java.net.*"%>

      <%@ page import="java.io.*"%>

      <%

          String Username = "";

          String homeUrl = ""; 

          String url="";

          homeUrl = "http://172.16.2.22:8000";

          Username = com.baosight.buapx.security.common.UserInfoUtil.getLoginName(request);

          if(Username!=null){

              try {

                      

                              //***********以下实现单点登陆**********************************************

                              String Password = null;

                              Connection   conn = null;

                              PreparedStatement pstmt = null;

                              ResultSet rs = null;

                              conn = Utils.getConnection();  

                              String sql = "select cux_sso_login_utl.get_ebs_user_pwd(:1) ebs_password FROM DUAL ";

                              try {

                                    pstmt = conn.prepareStatement(sql);

                                    pstmt.setString(1, Username);

                                    rs = pstmt.executeQuery();

                                    while (rs.next()) {

                                      Password = rs.getString("ebs_password");

                                    }

                                  } catch (SQLException e) {

                                    // TODO Auto-generated catch block

                                    e.printStackTrace();

                                    response.sendRedirect(homeUrl+"/TEST1");

                                  }finally {

                                    try {

                                      rs.close();

                                      pstmt.close();

                                      conn.close();

                                    } catch (Exception se) {

                                    }

                                  } 

                              if (Password == null || Username ==null){

                                  response.sendRedirect(homeUrl+"/TEST2");

                                  out.println("用户名 " + Username + " 在EBS系统中不存在!");

                                  conn.close();

                                  response.sendRedirect(homeUrl+"用户名 " + Username + " 在EBS系统中不存在!");

                                  return;

                                 }

                              if (Username =="@#$"){

                                  response.sendRedirect(homeUrl+"/TEST3");

                                  out.println("未能返回关联EBS用户!");

                                  conn.close();

                                  response.sendRedirect(homeUrl+"用户名 " + Username + " 在EBS系统中不存在!");

                                  return;

                                 }

       

                              try{   

                                    //url = homeUrl + "/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE&lang_code=ZHS&env=NLS_LANG='SIMPLIFIED+CHINESE_AMERICA.UTF8'";

                                    url = homeUrl + "/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE&lang_code=ZHS";

                                    if (!SessionMgr.isValidGuestSession(request)){

                                    homeUrl=homeUrl + "/TEST10";

                                    SessionMgr.createAppsSession(Username, Password, request, response); 

                                    homeUrl=homeUrl + "/TEST11";    

                                    if (conn.isClosed()){

                                      conn = Utils.getConnection();  

                                      conn.commit();

                                    }else

                                    {

                                       conn.commit();

                                    }

                                    homeUrl=homeUrl + "/TEST12";

                                    }

                                    response.sendRedirect(url);

                                  }catch (Exception e) {

                                      

                                      e.printStackTrace();

                                      //response.sendRedirect(homeUrl+"/TEST4");

                                      //response.sendRedirect(homeUrl+"/Username" + Username + "Password"+Password);        

                                      response.sendRedirect(homeUrl+"/Username" + Username + "Password"+Password+e.toString());

                                       

                                  }finally {

                                    conn.close();

                                  }

       

                                 

                          

                              //***********以下实现单点登陆**********************************************

                  } catch (java.net.MalformedURLException e) {

                          e.printStackTrace();

                  } 

            }

      %>