传智播客java学习 教育办公系统4
今天继续教育办公系统的旅程,今天主要讲的是权限模块:
1. 集成 spring-security 框架
1). 加入 spring-security 的两个 jar 包
2). 在 web.xml 文件中加入加入 spring-security 框架的过滤器
3). 新建 applicationContext-security.xml 配置文件,并且把 security 作为默认的命名空间,
并将其导入到 applicationContext.xml 中
4). 设计领域模型:
Authority -- 权限
Resource -- 资源
Role -- 角色
Employee -- 添加 Set<Role> roleSet
属性
Resource 和 Authority 为多对多的对应关系
Authority 和 Role 为多对多的对应关系
Role 和 Employee 为多对多的对应关系
所以还需要 3 个额外的关联表
** 数据表设计参见 spring-security-2
5).
①. 修改当前系统的 login.jsp 页面, 改为 spring-security 的登录页面, 并且在
<http> 节点中进行配置.
** 注意:
spring-security 在登录成功后, 利用 "重定向" 转到 form-login 节点对应的
default-target-url 属性对应的页面. 所以不能直接将其配置为
相关文档:
请看下面一例:
public class TestAbstract {
int count;
public void operation(){
System.out.println("count = " + (++count));
}
}
public class Test extends TestAbstract {
public static void main(String[] args) {
Test test = new Test();
TestAbstract testAb = new TestAbstract();
testAb.operati ......
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体" ......
class Global {
public static final String APPNAME= "xyz"; //全局常量
public static String currentUser = "abc"; // 全 ......
JAVA有好多东东
前几天看了看 没怎么通明白
今天早晨3点45看了会 国际米兰 客场挑战 切尔西的比赛
哎呀 很爽
魔力鸟重返斯坦福桥
我就想啊 这JAVA不是有个回访的函数吗
呵呵 忘了叫啥了
安切洛蒂在米兰时期经常被动的挨到魔力鸟的国际米兰的打压
这何尝不是JAVA里面的那个继承吗
还有 今天国米在锋线上使 ......
今天继续佟老师的教育办公系统的旅程:
1. 员工录入的服务器端的简单验证:
1). 使用 struts 的 validator 框架
2). 验证规则同浏览器端的 jQuery 的 validator 验证.
3). 以 email 字段为例, 验证 ......