A.JSP
var arr = window.showModalDialog("tmp", "", "font-family:Verdana; font-size:12; dialogWidth:23em; dialogHeight:21em");
if (arr != null) alert(arr);
B.JSPwindow.returnvalue="1";
window.close();
var arr = window.showModalDialog("tmp", "", "font-family:Verdana; font-size:12; dialogWidth:23em; dialogHeight:21em");
if (arr != null) alert(arr);
B.JSPwindow.returnvalue="1";
window.close();
String ErrorInfo="";
try {
con.setAutoCommit(false);//可能抛出SQL异常
CurriculaTestQuesDAO quesDAO = new CurriculaTestQuesDAO(con);
CurriculaTestDAO testDAO = new CurriculaTestDAO(con); if (testDAO.selectByFK(ques.getCurriculaId()).getId() == 0) {
CurriculaTest test = new CurriculaTest();
test.setCurriculaId(ques.getCurriculaId());
test.setIsActived(false);
testDAO.insert(test);//可能抛出CustomException
}
quesDAO.insert(ques);//可能抛出CustomException testDAO.updateCount(CurriculaManageBO.ADD_QUES, ques.getCurriculaId());//可能抛出CustomException
con.commit();//可能抛出SQL异常
}
catch (Exception ex) {
try {
con.rollback();//可能抛出SQL异常
ifError=true;
ErrorInfo=ex.getMessage()+"\n";
}
catch (SQLException ex1) {
ifError=true;
ErrorInfo=ErrorInfo+ex1.getMessage()+"\n";
}
}
finally{
try {
con.setAutoCommit(true);//可能抛出SQL异常
}
catch (SQLException ex2) {
ifError=true;
ErrorInfo=ErrorInfo+ex2.getMessage()+"\n";
}
this.closeConnection(con);
if (ifError)
{
throw new CustomException(CustomException.DB_FETCH_DATA_ERROR,ErrorInfo);
}
}
}
form2(弹出的页面)text2
在form2中可以用jscript的window.opener.test1.value=form2.text2.value