Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何避免在ADF中显示错误消息后转到下一页?_Java_Action_Actionlistener_Oracle Adf - Fatal编程技术网

Java 如何避免在ADF中显示错误消息后转到下一页?

Java 如何避免在ADF中显示错误消息后转到下一页?,java,action,actionlistener,oracle-adf,Java,Action,Actionlistener,Oracle Adf,我有一个问题。我需要检查来自查看对象的电子邮件。如果电子邮件不存在,我将执行一些代码。如果电子邮件已经存在,它将显示一些电子邮件已经存在的消息 目前我已经这样做了,如果电子邮件存在,“此电子邮件已使用”消息将抛出。 但我的问题是,如果该消息被抛出,用户仍然可以转到下一页。所以,如果收到此消息,如何阻止用户转到下一页 我在此附上一些代码: public void saveAdditionalProfile(ActionEvent event) { { // saveAn

我有一个问题。我需要检查来自查看对象的电子邮件。如果电子邮件不存在,我将执行一些代码。如果电子邮件已经存在,它将显示一些电子邮件已经存在的消息

目前我已经这样做了,如果电子邮件存在,“此电子邮件已使用”消息将抛出。 但我的问题是,如果该消息被抛出,用户仍然可以转到下一页。所以,如果收到此消息,如何阻止用户转到下一页

我在此附上一些代码:

   public void saveAdditionalProfile(ActionEvent event) { {
    //        saveAndExit()
    try {

        int rowCount = 0;
        ViewObject emailVO1 = appModule.getIwteEmployeeVO1();
        currentRow = emailVO1.getCurrentRow();
        String strEmail1 = (String)currentRow.getAttribute("Email1");
        String SSN = (String)currentRow.getAttribute("Ssn");
        rowCount = getEmpCountByEmail(strEmail1, SSN);


        if(rowCount == 0){
       //have another method here


        }
        else{
            Util.displayErrorMessage("Email has been used.");   
        }

    } catch (Exception e) {
        // TODO: Add catch code
        e.printStackTrace();
    }

}
public static int getEmpCountByEmail(String email, String SSN) {
    AppModuleImpl appModule = Util.getAppmodule("AppModuleDataControl");        
    ViewObjectImpl emailVO = appModule.getIwteEmployeeVO1();
    emailVO.setWhereClause("UPPER(Email1) = '" + email.toUpperCase() + "' AND SSN <> '"+ SSN + "'");
    emailVO.executeQuery();
    emailVO.setWhereClause("");

    return emailVO.getRowCount();
}  
public void saveAdditionalProfile(ActionEvent事件){{
//saveAndExit()
试一试{
int rowCount=0;
ViewObject emailVO1=appModule.GetIWTeeEmployeeVO1();
currentRow=emailVO1.getCurrentRow();
String strEmail1=(String)currentRow.getAttribute(“Email1”);
字符串SSN=(字符串)currentRow.getAttribute(“SSN”);
rowCount=getEmpCountByEmail(strEmail1,SSN);
如果(行计数==0){
//这里有另一种方法吗
}
否则{
Util.displayErrorMessage(“已使用电子邮件”);
}
}捕获(例外e){
//TODO:添加捕获代码
e、 printStackTrace();
}
}
公共静态int getEmpCountByEmail(字符串电子邮件,字符串SSN){
AppModuleImpl appModule=Util.getAppmodule(“AppModuleDataControl”);
ViewObjectImpl emailVO=appModule.getIwteEmployeeVO1();
emailVO.setWhereClause(“上限(Email1)='”+email.toUpperCase()+“'和SSN'+SSN+””);
emailVO.executeQuery();
emailVO.SetWhere条款(“”);
返回emailVO.getRowCount();
}  

如何导航到下一页? 如何调用上层方法

如果上面的方法是invoke以导航到下一页,那么很容易

 else{
      Util.displayErrorMessage("Email has been used.");   
      break;
     }

这应该可以解决问题。

Hi…感谢您的回复。我有一个按钮可以执行此操作。我在按钮上放置了一些操作,可以将数据提交到下一页。例如:`按钮保存和下一个操作侦听器:{pageFlowScope.profileBean.saveAdditionalProfile}操作:摘要(下一页的操作调用摘要).Action listener将调用我在上面显示的方法。我可以使用“break”来避免它吗?