首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

关于标签开发的1点注意

2012-10-09 
关于标签开发的一点注意????? 以前,我开发的标签是传入参数,然后从数据库中读取数据,标签抛出tagexception

关于标签开发的一点注意

????? 以前,我开发的标签是传入参数,然后从数据库中读取数据,标签抛出tagexception。 但是现在,我改变了,不再从数据库读取。需要的数据先从action 当中 初始化,然后在页面中 传入 tag 标签。这样,遇到数据错误的话,可以直接 在action 中抛出错误,转到 错误提示页面。

Action:把数据放入 request 中:

try {request.setAttribute("pgList", PageDao.getInstance().getPageListByPageId(pageId, null));request.setAttribute("fieldDescribes", FieldDao.getInstance().getFieldDescribeList());request.setAttribute("sfList", SchemeDao.getInstance().getSchemeFactorList(schemeCode, null));} catch (com.cpic.ryx.except.DaoException e) {// TODO Auto-generated catch blocklog.error("查询页面配置列表出错");errors.add("查询页面配置列表出错");request.setAttribute("ryx_errors", errors);return mapping.findForward("errorPage");}

?

?

HTML:

<ryx:baseInfoSet sfList="${sfList}" pgList="${pgList}" fieldDescribes="${fieldDescribes}"/>

?

?

?

热点排行