`
zisefeiniao
  • 浏览: 172463 次
  • 性别: Icon_minigender_2
  • 来自: 成都
社区版块
存档分类
最新评论
阅读更多
新的框架,新的概念,学习完之后当然是要练啦,在MLDN学习的这段时间,真的能感觉到一点,学完的知识马上可以利用,可以很快的利用这些知识快速的构建一个系统,一个系统构建完成之后还要不断的思考问题,呵呵,还不错啦。





计划内任务

任务编号
任务名称
最晚结束日期
工作量
任务完成标准
完成状态

1
建库建表
2009/0514
2009/05/14
建立数据库及tadmin表和tuser
Y

3
DAO
2009/0514
2009/05/14
 
Y

3
普通用户登陆
2009/0514
2009/05/14
(1)用户名(非空)、

密码(非空,MD5加密)、

验证码(非空,并输入正确,不区分大小写)

(2)任一项错误返回登录页,并回填用户名,并显示相应错误信息

(3)正确后,进入主页,显示欢迎***登陆

(如附图)
Y

4
管理员登陆
2009/0514
2009/05/14
(1)用户名(非空)、

密码(非空,MD5加密)、

验证码(非空,并输入正确,不区分大小写)

(2)任一项错误返回登录页,并回填用户名,并显示相应错误信息

(3)正确后,进入主页, 显示欢迎***登陆

(如附图)
Y

5
显示所有权限
2009/0514
2009/05/14
(如附图)
Y

临时任务


 
 
 
 
 


 
 
 
 
 






4. 遇到的问题及解决方式(必填)
________________________________________
1、如何区分,用户是单击登陆按钮还是注册按钮
未解决

2、显示权限
方法一:一次性
<tr bgcolor="#E6E6E6">
<td align="center">用户管理权限</td>
<td align="center">
  <logic:match value="C:Y" name="tadmin" property="userflag" scope="session">
  拥有
  </logic:match>
  <logic:match value="C:N" name="tadmin" property="userflag" scope="session">
  没有
  </logic:match>
</td>
<td align="center">
  <logic:match value="D:Y" name="tadmin" property="userflag" scope="session">
  拥有
  </logic:match>
  <logic:match value="D:N" name="tadmin" property="userflag" scope="session">
  没有
  </logic:match>
</td>
<td align="center">
  <logic:match value="U:Y" name="tadmin" property="userflag" scope="session">
  拥有
  </logic:match>
  <logic:match value="U:N" name="tadmin" property="userflag" scope="session">
  没有
  </logic:match>
</td>
<td align="center">
  <logic:match value="R:Y" name="tadmin" property="userflag" scope="session">
  拥有
  </logic:match>
  <logic:match value="R:N" name="tadmin" property="userflag" scope="session">
  没有
  </logic:match>
</td>
</tr>

方法二:
(1)定义一个权限的vo
package mldn.lin.vo;

public class Power {
private boolean userflagC;
private boolean userflagR;
private boolean userflagU;
private boolean userflagD;

private boolean itemflagC;
private boolean itemflagR;
private boolean itemflagU;
private boolean itemflagD;

private boolean subitemflagC;
private boolean subitemflagR;
private boolean subitemflagU;
private boolean subitemflagD;

private boolean courseflagC;
private boolean courseflagR;
private boolean courseflagU;
private boolean courseflagD;

private boolean libraryflagC;
private boolean libraryflagR;
private boolean libraryflagU;
private boolean libraryflagD;

private boolean teacherflagC;
private boolean teacherflagR;
private boolean teacherflagU;
private boolean teacherflagD;

private boolean infoflagC;
private boolean infoflagR;
private boolean infoflagU;
private boolean infoflagD;

private boolean logflagC;
private boolean logflagR;
private boolean logflagU;
private boolean logflagD;

private boolean adminflagC;
private boolean adminflagR;
private boolean adminflagU;
private boolean adminflagD;

private boolean deptflagC;
private boolean deptflagR;
private boolean deptflagU;
private boolean deptflagD;

public Power(){
  super();
}

public boolean isUserflagC() {
  return userflagC;
}
public void setUserflagC(boolean userflagC) {
  this.userflagC = userflagC;
}
public boolean isUserflagR() {
  return userflagR;
}
public void setUserflagR(boolean userflagR) {
  this.userflagR = userflagR;
}
public boolean isUserflagU() {
  return userflagU;
}
public void setUserflagU(boolean userflagU) {
  this.userflagU = userflagU;
}
public boolean isUserflagD() {
  return userflagD;
}
public void setUserflagD(boolean userflagD) {
  this.userflagD = userflagD;
}
public boolean isItemflagC() {
  return itemflagC;
}
public void setItemflagC(boolean itemflagC) {
  this.itemflagC = itemflagC;
}
public boolean isItemflagR() {
  return itemflagR;
}
public void setItemflagR(boolean itemflagR) {
  this.itemflagR = itemflagR;
}
public boolean isItemflagU() {
  return itemflagU;
}
public void setItemflagU(boolean itemflagU) {
  this.itemflagU = itemflagU;
}
public boolean isItemflagD() {
  return itemflagD;
}
public void setItemflagD(boolean itemflagD) {
  this.itemflagD = itemflagD;
}
public boolean isSubitemflagC() {
  return subitemflagC;
}
public void setSubitemflagC(boolean subitemflagC) {
  this.subitemflagC = subitemflagC;
}
public boolean isSubitemflagR() {
  return subitemflagR;
}
public void setSubitemflagR(boolean subitemflagR) {
  this.subitemflagR = subitemflagR;
}
public boolean isSubitemflagU() {
  return subitemflagU;
}
public void setSubitemflagU(boolean subitemflagU) {
  this.subitemflagU = subitemflagU;
}
public boolean isSubitemflagD() {
  return subitemflagD;
}
public void setSubitemflagD(boolean subitemflagD) {
  this.subitemflagD = subitemflagD;
}
public boolean isCourseflagC() {
  return courseflagC;
}
public void setCourseflagC(boolean courseflagC) {
  this.courseflagC = courseflagC;
}
public boolean isCourseflagR() {
  return courseflagR;
}
public void setCourseflagR(boolean courseflagR) {
  this.courseflagR = courseflagR;
}
public boolean isCourseflagU() {
  return courseflagU;
}
public void setCourseflagU(boolean courseflagU) {
  this.courseflagU = courseflagU;
}
public boolean isCourseflagD() {
  return courseflagD;
}
public void setCourseflagD(boolean courseflagD) {
  this.courseflagD = courseflagD;
}
public boolean isLibraryflagC() {
  return libraryflagC;
}
public void setLibraryflagC(boolean libraryflagC) {
  this.libraryflagC = libraryflagC;
}
public boolean isLibraryflagR() {
  return libraryflagR;
}
public void setLibraryflagR(boolean libraryflagR) {
  this.libraryflagR = libraryflagR;
}
public boolean isLibraryflagU() {
  return libraryflagU;
}
public void setLibraryflagU(boolean libraryflagU) {
  this.libraryflagU = libraryflagU;
}
public boolean isLibraryflagD() {
  return libraryflagD;
}
public void setLibraryflagD(boolean libraryflagD) {
  this.libraryflagD = libraryflagD;
}
public boolean isTeacherflagC() {
  return teacherflagC;
}
public void setTeacherflagC(boolean teacherflagC) {
  this.teacherflagC = teacherflagC;
}
public boolean isTeacherflagR() {
  return teacherflagR;
}
public void setTeacherflagR(boolean teacherflagR) {
  this.teacherflagR = teacherflagR;
}
public boolean isTeacherflagU() {
  return teacherflagU;
}
public void setTeacherflagU(boolean teacherflagU) {
  this.teacherflagU = teacherflagU;
}
public boolean isTeacherflagD() {
  return teacherflagD;
}
public void setTeacherflagD(boolean teacherflagD) {
  this.teacherflagD = teacherflagD;
}
public boolean isInfoflagC() {
  return infoflagC;
}
public void setInfoflagC(boolean infoflagC) {
  this.infoflagC = infoflagC;
}
public boolean isInfoflagR() {
  return infoflagR;
}
public void setInfoflagR(boolean infoflagR) {
  this.infoflagR = infoflagR;
}
public boolean isInfoflagU() {
  return infoflagU;
}
public void setInfoflagU(boolean infoflagU) {
  this.infoflagU = infoflagU;
}
public boolean isInfoflagD() {
  return infoflagD;
}
public void setInfoflagD(boolean infoflagD) {
  this.infoflagD = infoflagD;
}
public boolean isLogflagC() {
  return logflagC;
}
public void setLogflagC(boolean logflagC) {
  this.logflagC = logflagC;
}
public boolean isLogflagR() {
  return logflagR;
}
public void setLogflagR(boolean logflagR) {
  this.logflagR = logflagR;
}
public boolean isLogflagU() {
  return logflagU;
}
public void setLogflagU(boolean logflagU) {
  this.logflagU = logflagU;
}
public boolean isLogflagD() {
  return logflagD;
}
public void setLogflagD(boolean logflagD) {
  this.logflagD = logflagD;
}
public boolean isAdminflagC() {
  return adminflagC;
}
public void setAdminflagC(boolean adminflagC) {
  this.adminflagC = adminflagC;
}
public boolean isAdminflagR() {
  return adminflagR;
}
public void setAdminflagR(boolean adminflagR) {
  this.adminflagR = adminflagR;
}
public boolean isAdminflagU() {
  return adminflagU;
}
public void setAdminflagU(boolean adminflagU) {
  this.adminflagU = adminflagU;
}
public boolean isAdminflagD() {
  return adminflagD;
}
public void setAdminflagD(boolean adminflagD) {
  this.adminflagD = adminflagD;
}
public boolean isDeptflagC() {
  return deptflagC;
}
public void setDeptflagC(boolean deptflagC) {
  this.deptflagC = deptflagC;
}
public boolean isDeptflagR() {
  return deptflagR;
}
public void setDeptflagR(boolean deptflagR) {
  this.deptflagR = deptflagR;
}
public boolean isDeptflagU() {
  return deptflagU;
}
public void setDeptflagU(boolean deptflagU) {
  this.deptflagU = deptflagU;
}
public boolean isDeptflagD() {
  return deptflagD;
}
public void setDeptflagD(boolean deptflagD) {
  this.deptflagD = deptflagD;
}
}

(2)登陆成功后,设置权限至session中
//管理员登陆成更后,将其权限设置到session中
Power power=powerSplit(tadmin);
request.getSession().setAttribute("power", power);
public Power powerSplit(Tadmin tadmin){
  Power power=new Power();
  String[] userflag=tadmin.getUserflag().split("\\|");
  power.setUserflagC(userflag[0].split(":")[1].equals("Y"));
  power.setUserflagR(userflag[1].split(":")[1].equals("Y"));
  power.setUserflagU(userflag[2].split(":")[1].equals("Y"));
  power.setUserflagD(userflag[3].split(":")[1].equals("Y"));
 
  String[] itemflag=tadmin.getItemflag().split("\\|");
  power.setItemflagC(itemflag[0].split(":")[1].equals("Y"));
  power.setItemflagR(itemflag[1].split(":")[1].equals("Y"));
  power.setItemflagU(itemflag[2].split(":")[1].equals("Y"));
  power.setItemflagD(itemflag[3].split(":")[1].equals("Y"));
 
  String[] subitemflag=tadmin.getSubitemflag().split("\\|");
  power.setSubitemflagC(subitemflag[0].split(":")[1].equals("Y"));
  power.setSubitemflagR(subitemflag[1].split(":")[1].equals("Y"));
  power.setSubitemflagU(subitemflag[2].split(":")[1].equals("Y"));
  power.setSubitemflagD(subitemflag[3].split(":")[1].equals("Y"));
 
  String[] courseflag=tadmin.getCourseflag().split("\\|");
  power.setCourseflagC(courseflag[0].split(":")[1].equals("Y"));
  power.setCourseflagR(courseflag[1].split(":")[1].equals("Y"));
  power.setCourseflagU(courseflag[2].split(":")[1].equals("Y"));
  power.setCourseflagD(courseflag[3].split(":")[1].equals("Y"));
 
  String[] libraryflag=tadmin.getLibraryflag().split("\\|");
  power.setLibraryflagC(libraryflag[0].split(":")[1].equals("Y"));
  power.setLibraryflagR(libraryflag[1].split(":")[1].equals("Y"));
  power.setLibraryflagU(libraryflag[2].split(":")[1].equals("Y"));
  power.setLibraryflagD(libraryflag[3].split(":")[1].equals("Y"));
 
  String[] teacherflag=tadmin.getTeacherflag().split("\\|");
  power.setTeacherflagC(teacherflag[0].split(":")[1].equals("Y"));
  power.setTeacherflagR(teacherflag[1].split(":")[1].equals("Y"));
  power.setTeacherflagU(teacherflag[2].split(":")[1].equals("Y"));
  power.setTeacherflagD(teacherflag[3].split(":")[1].equals("Y"));
 
  String[] infoflag=tadmin.getInfoflag().split("\\|");
  power.setInfoflagC(infoflag[0].split(":")[1].equals("Y"));
  power.setInfoflagR(infoflag[1].split(":")[1].equals("Y"));
  power.setInfoflagU(infoflag[2].split(":")[1].equals("Y"));
  power.setInfoflagD(infoflag[3].split(":")[1].equals("Y"));
 
  String[] logflag=tadmin.getLogflag().split("\\|");
  power.setLogflagC(logflag[0].split(":")[1].equals("Y"));
  power.setLogflagR(logflag[1].split(":")[1].equals("Y"));
  power.setLogflagU(logflag[2].split(":")[1].equals("Y"));
  power.setLogflagD(logflag[3].split(":")[1].equals("Y"));
 
  String[] adminflag=tadmin.getAdminflag().split("\\|");
  power.setAdminflagC(adminflag[0].split(":")[1].equals("Y"));
  power.setAdminflagR(adminflag[1].split(":")[1].equals("Y"));
  power.setAdminflagU(adminflag[2].split(":")[1].equals("Y"));
  power.setAdminflagD(adminflag[3].split(":")[1].equals("Y"));
 
  String[] deptflag=tadmin.getDeptflag().split("\\|");
  power.setDeptflagC(deptflag[0].split(":")[1].equals("Y"));
  power.setDeptflagR(deptflag[1].split(":")[1].equals("Y"));
  power.setDeptflagU(deptflag[2].split(":")[1].equals("Y"));
  power.setDeptflagD(deptflag[3].split(":")[1].equals("Y"));
 
  return power;
}
(3)页面显示
    <tr bgcolor="#E6E6E6">
     <td align="center">用户管理权限</td>
     <td align="center">${sessionScope.power.userflagC}</td>
     <td align="center">${sessionScope.power.userflagD}</td>
     <td align="center">${sessionScope.power.userflagU}</td>
     <td align="center">${sessionScope.power.userflagR}</td>
    </tr>

分享到:
评论
2 楼 zisefeiniao 2009-05-16  
http://blog.sina.com.cn/zisefeiniao
你可以去我这里看,呵呵
1 楼 CoderDream 2009-05-16  
请发布Blog前编辑一下,图片、表格等等。你的Blog让人阅读起来很累!

相关推荐

Global site tag (gtag.js) - Google Analytics