Subversion Repositories general

Rev

Blame | Last modification | View Log | RSS feed

/**
 * Extends and based on Apache Struts source code.
 *
 * Copyleft Anatoli Klassen (anatoli@aksoft.net)
 */
package ak.strutsx.taglib;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;

import org.apache.struts.Globals;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;

public class RootTag
        extends TagSupport
{
    public int doStartTag()
        throws JspException
    {
        HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();

        try {
            pageContext.getOut().write(request.getContextPath());
        }
        catch(IOException ex) {
            throw new JspException("Cannot write to output" + ex);
        }

        return EVAL_BODY_INCLUDE;
    }
}