传智播客java学习 教育办公系统5
今天继续学习佟老师的教育办公系统的旅程,今天主要学习权限模块和员工模块的集成;
1.
集成权限模块和员工模块
.
1).
新录入员工时
,
可以为其添加角色
①
.
使用
jQuery
的
weebox
插件弹出角色的对话框
2).
修改员工时
,
可以为其修改角色
3).
实现导航的页面的权限化
,
根据当前登录员工的权限定制
struts-menu,
并添加登出功能
.
①
.
参考
struts-menu
例程中的
Dynamic, Databased-driven Menu
链接中的代码
,
提供模拟实现
-
员工管理
-
员工添加
-
员工查询
②
.
修改
Authority
领域模型使其适应
struts-menu
实现
:
private Authority parentAuthority;
private Set<Authority>
subAuthorities;
private Resource mainResource;
private int isNavigate;
&nb
相关文档:
只针对不正常的条件才使用异常
异常只应该被用于不正常的条件,它们永远不应被用于正常的控制流。
下面是一个用异常作遍历结束条件的滥用异常的例子:
//horrible abuse of exceptions. Don't ever do this!
try{
int i=0;
while(true)a[i++].f();
}catch(ArrayIndexOutOfBoundsException e){
......
public class DeadLock {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
final Object resource1 = "resource1";
final Object resource2 = "resource2";
Thread t1 = new Thread(){
public void run(){
syn ......
<!--
@page { size: 21cm 29.7cm; margin: 2cm }
P { margin-bottom: 0.21cm }
-->
Swing
是目前
Java
中不可缺少的窗口工具组,是用户建立图形化用户界面(
GUI
)程序的强大工具。
Java Swing
组件自动产生各种事件来响应用户行为。如当用户点击按钮或选择菜单项 ......
Integer n1 = new Integer(1);
Integer n2 = new Integer(1);
System.out.println(n1==n2); // false
Integer n1 = new Integer(3);
Integer n2 = new Integer(3);
System.out.println(n1.equals(n2)); //true
equals()默认也是比较reference,但是Java中的class覆盖了equals()方法 ......