⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bannertag.java

📁 《Java网络程序设计.rar》包括三个网络程序的源代码。
💻 JAVA
字号:
package org.impact.stars.taglib.banner;import javax.servlet.jsp.*;import javax.servlet.jsp.tagext.*;import org.impact.stars.control.web.ProfileMgrWebImpl;import org.impact.stars.organizationmd.profilemgr.model.ExplicitInformation;/* * BannerTag * --------- * On hitting the start tag, attempts to find the ProfileMgrWebImpl bean and * and determine if the banner option is on.  If the profilemgr bean exists * and the banner option is on, the body is processed.  A method is also * provided for inner tags (i.e. BannerImgTag) to retrieve the banner string. * All accesses to the profileMgr bean happen in this tag.  If it is not found * a Jsp exception is not thrown.  Rather, the body is just not included. * * The banner tag might be used like this, assuming the tag library is * identified with "j2ee", and the profilemgr bean is initialized and present * in the jsp page: * * <j2ee:banner> *  <img src="<%=request.getContextPath()%>/<j2ee:bannerImg />"> * </j2ee:banner> */public class BannerTag extends TagSupport {  private ProfileMgrWebImpl profileMgrBean;  public int doStartTag() {    profileMgrBean =      (ProfileMgrWebImpl) pageContext.findAttribute("profilemgr");    if (profileMgrBean == null) return(SKIP_BODY);    ExplicitInformation eInfo = profileMgrBean.getExplicitInformation();    if (!eInfo.getBannerOpt()) return(SKIP_BODY);    else return(EVAL_BODY_INCLUDE);  }  public String getBannerString() {    //return(profileMgrBean.getBanner());    return "BannerTag not used";  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -