📄 layouttag.java
字号:
{ request.setAttribute("dspace.layout.feedref", "NONE" ); } // Now include the header try { HttpServletResponse response = (HttpServletResponse) pageContext .getResponse(); // Set headers to prevent browser caching, if appropriate if ((noCache != null) && noCache.equalsIgnoreCase("true")) { response.addDateHeader("expires", 1); response.addHeader("Pragma", "no-cache"); response.addHeader("Cache-control", "no-store"); } // Ensure the HTTP header will declare that UTF-8 is used // in the response. response.setContentType("text/html; charset=UTF-8"); ServletConfig config = pageContext.getServletConfig(); RequestDispatcher rd = config.getServletContext() .getRequestDispatcher(header); rd.include(request, response); } catch (IOException ioe) { throw new JspException("Got IOException: " + ioe); } catch (ServletException se) { log.warn("Exception", se.getRootCause()); throw new JspException("Got ServletException: " + se); } return EVAL_BODY_INCLUDE; } public int doEndTag() throws JspException { // Footer file to use String footer = "/layout/footer-default.jsp"; // Choose default flavour unless one is specified if (style != null) { footer = "/layout/footer-" + style.toLowerCase() + ".jsp"; } try { // Ensure body is included before footer pageContext.getOut().flush(); // Context objects ServletRequest request = pageContext.getRequest(); ServletResponse response = pageContext.getResponse(); ServletConfig config = pageContext.getServletConfig(); if (sidebar != null) { request.setAttribute("dspace.layout.sidebar", sidebar); } RequestDispatcher rd = config.getServletContext() .getRequestDispatcher(footer); rd.include(request, response); } catch (ServletException se) { throw new JspException("Got ServletException: " + se); } catch (IOException ioe) { throw new JspException("Got IOException: " + ioe); } return EVAL_PAGE; } /** * Get the value of title. * * @return Value of title. */ public String getTitle() { return title; } /** * Set the value of title. * * @param v * Value to assign to title. */ public void setTitle(String v) { this.title = v; } /** * @return Returns the titleKey. */ public String getTitlekey() { return titleKey; } /** * @param titleKey The titleKey to set. */ public void setTitlekey(String titleKey) { this.titleKey = titleKey; } /** * Get the value of navbar. * * @return Value of navbar. */ public String getNavbar() { return navbar; } /** * Set the value of navbar. * * @param v * Value to assign to navbar. */ public void setNavbar(String v) { this.navbar = v; } /** * Get the value of locbar. * * @return Value of locbar. */ public String getLocbar() { return locbar; } /** * Set the value of locbar. * * @param v * Value to assign to locbar. */ public void setLocbar(String v) { this.locbar = v; } /** * Get the value of parentTitle. * * @return Value of parentTitle. */ public String getParenttitle() { return parentTitle; } /** * Set the value of parent. * * @param v * Value to assign to parent. */ public void setParenttitle(String v) { this.parentTitle = v; } /** * get parent title key (from message dictionary) * * @return Returns the parentTitleKey. */ public String getParenttitlekey() { return parentTitleKey; } /** * set parent title key (from message dictionary) * * @param parentTitleKey The parentTitleKey to set. */ public void setParenttitlekey(String parentTitleKey) { this.parentTitleKey = parentTitleKey; } /** * Get the value of parentlink. * * @return Value of parentlink. */ public String getParentlink() { return parentLink; } /** * Set the value of parentlink. * * @param v * Value to assign to parentlink. */ public void setParentlink(String v) { this.parentLink = v; } /** * Get the value of style. * * @return Value of style. */ public String getStyle() { return style; } /** * Set the value of style. * * @param v * Value to assign to style. */ public void setStyle(String v) { this.style = v; } /** * Get the value of sidebar. * * @return Value of sidebar. */ public String getSidebar() { return sidebar; } /** * Set the value of sidebar. * * @param v * Value to assign to sidebar. */ public void setSidebar(String v) { this.sidebar = v; } /** * Get the value of sidebar. * * @return Value of sidebar. */ public String getNocache() { return noCache; } /** * Set the value of sidebar. * * @param v * Value to assign to sidebar. */ public void setNocache(String v) { this.noCache = v; } /** * Get the value of feedData. * * @return Value of feedData. */ public String getFeedData() { return feedData; } /** * Set the value of feedData. * * @param v * Value to assign to feedData. */ public void setFeedData(String v) { this.feedData = v; } public void release() { style = null; title = null; sidebar = null; navbar = null; locbar = null; parentTitle = null; parentLink = null; noCache = null; feedData = null; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -