📄 functionmanagelisttag.java
字号:
/**
*
*/
package com.seavision.PermissionManage.tag;
import java.util.HashMap;
import java.util.List;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import com.seavision.PermissionManage.common.BaseTag;
import com.seavision.PermissionManage.components.FunctionManage;
import com.seavision.PermissionManage.help.DaoFectory;
import com.seavision.PermissionManage.vo.FunctionVO;
import com.seavision.PermissionManage.vo.UserVO;
/**
* @author qiao rong
* @date 2007-05-10
* @param null
* @function 功能点列表tag
* 循环打印功能表内所有信息
*
*/
public class FunctionManageListTag extends BaseTag{
public int doStartTag() throws JspException {
this.initializeTag("FunctionManageListTag"); // 初始化类
try {
this.appendMessage("<root>");
UserVO loguser = (UserVO) this.getAttribute("loginUserBean"); // 得到登陆用户的信息
String message = (String) this.getAttribute("message"); // 得到request中的message对象
this.removeAttribute("message"); // 删除session中message的信息
if (!this.check(loguser)) { // 判断用户登陆信息是否存在
message = "您还没有登录或您离开系统时间太久,请重新登录";
String ResultMsg = "登陆失败";
// --系统提示信息--
this.appendMessage("<system>");
this.appendMessage("<appMessage>");
this.appendMessage("<message>" + message + "</message>");
this.appendMessage("<ResultMsg>" + ResultMsg + "</ResultMsg>");
this.appendMessage("</appMessage>");
this.appendMessage("</system>");
} // end if
else {
FunctionVO functionVO = null; //功能点vo,从list取数据时暂存
List list_func = null; //存放功能点列表信息
//组件
FunctionManage functionManage = DaoFectory.getFunctionManage();
// 测试附初值
// list_func = (List)this.requestGetAttribute("list_role0");
//循环打印功能列表
list_func = functionManage.getFunctionName();
this.appendMessage("<orderList>");
for (int i = 0; i < list_func.size(); i++)
{
functionVO = (FunctionVO) list_func.get(i);
this.appendMessage("<order>");
this.appendMessage("<id>"
+ (i + 1) + "</id>");
this.appendMessage("<functionId>"
+ functionVO.getFunctionId() + "</functionId>");//功能点编号
this.appendMessage("<functionName>"
+ functionVO.getFunctionName() + "</functionName>"); //功能点名称
this.appendMessage("<url>"
+ functionVO.getUrl() + "</url>"); //url
this.appendMessage("</order>");
}
this.appendMessage("</orderList>");
}//end else
this.appendMessage("</root>");
this.outputMessage();
} catch (Exception ex) {
this.outputStandardErrorMessage();
ex.printStackTrace();
print("userlistTag出现异常");
} // end catch
return TagSupport.EVAL_BODY_INCLUDE; // 继续计算BODY体
} // end doStartTag method
public int doEndTag() throws JspException {
return EVAL_PAGE;
}// doEndTag method
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -