
使用WebApp的Servlet或Spring Controller,建立Login及Logout的動作,
Login:

Logout:

自從Hibernate 3.3 後複合主鍵才可以使用generator tag

1) Required - TheLoginModuleis required to succeed.
If it succeeds or fails, authentication still continues
to proceed down theLoginModulelist.
此LoginModule一定要驗証成功整個Login程序才會通過,無論驗証成敗,均會繼續
進行下一個LoginModule驗証。
2) Requisite - TheLoginModuleis required to succeed.
If it succeeds, authentication continues down the
LoginModulelist. If it fails,
control immediately returns to the application
(authentication does not proceed down the
LoginModulelist).
此LoginModule一定要驗証成功整個Login程序才會通過,驗証成功,則繼續進行
下一個LoginModule驗証,若驗証失敗,則不繼續進行下一個LoginModule驗証,
驗証程式完成。
3) Sufficient - TheLoginModuleis not required to
succeed. If it does succeed, control immediately
returns to the application (authentication does not
proceed down theLoginModulelist).
If it fails, authentication continues down the
LoginModulelist.
此LoginModule不一定要驗証成功,若驗証成功,則繼續進行則不繼續進行下一個
LoginModule驗証,若驗証失敗,則繼續進行下一個LoginModule驗証,
4) Optional - TheLoginModuleis not required to
succeed. If it succeeds or fails,
authentication still continues to proceed down the
LoginModulelist.
此LoginModule不一定要驗証成功,無論驗証成敗,均會進行下一個LoginModule驗証。