|
initsession
Initialize session
import javax.servlet.http.HttpSession;
public class InitSession {
public InitSession() {
}
/**
* Initialize the variables that should be saved in the session, including code and logger.
* @param session HttpSession
* @throws Exception
*/
public static void init(HttpSession session) throws Exception {
initCode(session);
// initLogger(session);
}
/**
* Initialize code.
* @param session HttpSession
* @throws Exception
*/
private static void initCode(HttpSession session) throws Exception {
if(session.getAttribute( "_CodeManager ")!=null)return;
// CommonLogger.getInstance().getLogger().info( "Start to initialize code");
CodeManager codeManager = CodeManager.getInstance();
codeManager.initCode();
session.setAttribute( "_CodeManager ", codeManager);
session.setAttribute( "_auditState ", codeManager.queryAuditState());
session.setAttribute( "_census ", codeManager.queryCensus());
session.setAttribute( "_educationalLevel ", codeManager.queryEducationalLevel());
session.setAttribute( "_education ", codeManager.queryEducation()); //Professional code of the Education Commission
session.setAttribute( "_studentType ", codeManager.queryStudentType());
session.setAttribute( "_subschool ", codeManager.querySubschool());
session.setAttribute( "_station ",codeManager.queryStation());
session.setAttribute( "_testSubject ", codeManager.queryTestSubject());
session.setAttribute( "_year ", codeManager.queryYear());
// System.out .println( "dddd "+codeManager.queryYear().size());
session.setAttribute( "_manageType ",codeManager.queryManageType());
session.setAttribute( "_stuType ",codeManager.queryStuType());
session.setAttribute( "_classGrade ",codeManager.queryClassgrade());
session.setAttribute( "_distributed ",codeManager.queryDistributed());
session.setAttribute( "_examSort ",codeManager.queryExamSort());//Exam category
session.setAttribute( "_examSchoolType ",codeManager.queryExamSchoolType());//Exam unit type
session.setAttribute( "_examItem ",codeManager.queryExamItem());//Exam item
session.setAttribute( "_employState ",codeManager.QueryEmployState() );//Employment status
session.setAttribute( "_statusState ",codeManager.queryStatusState() );
session.setAttribute( "_RewardPunishmentCode ",codeManager.queryRewardPunishmentCode() );
session.setAttribute( "_RewardLevelCode ",codeManager.queryRewardLevelCode() );
session.setAttribute( "_UndoSignalCode ",codeManager.queryUndoSignalCode() );
session.setAttribute( "_RewardPunishmentReason ",codeManager.queryRewardPunishmentReason() );
session.setAttribute( "_englishDegree ",codeManager.queryEnglishDegree());//English approval code
session.setAttribute( "_socialCourse ",codeManager.querySocialCourse());//Social course code (degree)
session.setAttribute( "_punishiment ",codeManager.queryPunishment());//The degree penalty approval code
session.setAttribute( "_score ",codeManager.queryScore());//Score code
session.setAttribute( "_teachDep ",codeManager.queryTeachDep());//Teaching department
session.setAttribute( "_institution ",codeManager.queryInstitution());//Institution
session.setAttribute( "_firstFocus ",codeManager.queryFirstFocus());//First time again
session.setAttribute( "_examTypeAlias ",codeManager.queryExamTypeAlias());//The evaluation method alias
session.setAttribute( "_startMark ",codeManager.queryStartMark());//Enable flag (course, teaching point professional)
session.setAttribute( "_approveMark ",codeManager.queryApproveMark());//Course approval mark
session.setAttribute( "_cancelMark ",codeManager.queryCancelMark());//Course stop sign
session.setAttribute( "_mediaType ", codeManager.queryMediaType()); //Media type
session.setAttribute( "_haveMark ", codeManager.queryHaveMark()); //A code table
session.setAttribute( "_generalCourse ", codeManager.queryGeneralCourse()); //General course list
session.setAttribute( "_generalCourse_IdName ", codeManager.queryGeneralCourse_IdName()); //General course list
session.setAttribute( "_transCode ", codeManager.queryTransCode()); //Transfer code
session.setAttribute( "_transCodeUp ", codeManager.queryTransCodeUp()); //Upload transmission code
session.setAttribute( "_transCodeReceive ", codeManager.queryTransCodeReceive()); //Receive transmission code
session.setAttribute( "_openSpeciality ", codeManager.queryOpenSpeciality()); //Open professional
session.setAttribute( "_credentialType ", codeManager.queryCredentialType()); //Certificate type
session.setAttribute( "_socialSubjcetSort ",codeManager.querySocialSubjcetSort());//Social subject category
session.setAttribute( "_examStateCode ",codeManager.queryExamStateCode());//The audit status code table
session.setAttribute( "_netExamCourse ",codeManager.queryNetExamCourse());//Net test subjects
CommonLogger.getInstance().getLogger().debug( "Initialized code completion");
}
} |
|