View Javadoc
1 /* 2 * Angkor Web Framework 3 * 4 * Distributable under LGPL license. 5 * See terms of license at gnu.org. 6 */ 7 8 package com.tirsen.angkor.jsp; 9 10 import com.tirsen.angkor.Application; 11 import com.tirsen.angkor.RenderContext; 12 13 import javax.servlet.http.HttpServletRequest; 14 import javax.servlet.jsp.JspException; 15 import javax.servlet.jsp.tagext.TagSupport; 16 import java.io.IOException; 17 18 /*** 19 * @author $Author: tirsen $ 20 * @version $Revision: 1.3 $ 21 * <BR> 22 * $Id: HeaderTag.java,v 1.3 2002/10/09 21:37:37 tirsen Exp $ 23 */ 24 public class HeaderTag extends TagSupport 25 { 26 public int doStartTag() throws JspException 27 { 28 return EVAL_BODY_INCLUDE; 29 } 30 31 public int doEndTag() throws JspException 32 { 33 HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); 34 RenderContext context = new RenderContext(pageContext); 35 Application application = context.getApplication(); 36 String base = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/"; 37 try 38 { 39 pageContext.getOut().write("<BASE href=\"" + base + "\" />"); 40 System.out.println("application.getWindowTitle() = " + application.getWindowTitle()); 41 if (application.getWindowTitle() != null) 42 { 43 pageContext.getOut().write("<TITLE>" + application.getWindowTitle() + "</TITLE>"); 44 } 45 } 46 catch (IOException e) 47 { 48 throw new JspException(e); 49 } 50 return super.doEndTag(); 51 } 52 }

This page was automatically generated by Maven