Subversion Repositories bacoAlunos

Rev

Rev 1310 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.web.tags;

import org.apache.log4j.Logger;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.httpclient.URIException;

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

import pt.estgp.estgweb.utils.Globals;

import java.util.Enumeration;

import jomm.utils.MessageResources;

public class ChartPageUrlStatTag extends TagSupport
{

    private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(ChartPageUrlStatTag.class);

    private 1.5.0/docs/api/java/lang/String.html">String attributes;

    private 1.5.0/docs/api/java/lang/String.html">String chartType;

    private 1.5.0/docs/api/java/lang/String.html">String altKey;

    public 1.5.0/docs/api/java/lang/String.html">String getAltKey()
    {
        return altKey;
    }

    public void setAltKey(1.5.0/docs/api/java/lang/String.html">String altKey)
    {
        this.altKey = altKey;
    }

    public 1.5.0/docs/api/java/lang/String.html">String getAttributes()
    {
        return attributes;
    }

    public 1.5.0/docs/api/java/lang/String.html">String getChartType()
    {
        return chartType;
    }

    public void setChartType(1.5.0/docs/api/java/lang/String.html">String chartType)
    {
        this.chartType = chartType;
    }

    public void setAttributes(1.5.0/docs/api/java/lang/String.html">String attributes)
    {
        this.attributes = attributes;
    }

    public int doStartTag() throws JspException
    {
        HttpServletRequest hrequest = (HttpServletRequest) pageContext.getRequest();
        1.5.0/docs/api/java/lang/String.html">String queryStr = hrequest.getQueryString();

        if(attributes == null)
            attributes = "";
        1.5.0/docs/api/java/lang/String.html">String alt = "";
        if(altKey != null)
            alt = MessageResources.getMessage(hrequest,altKey);

        1.5.0/docs/api/java/lang/String.html">String img = "<img " + attributes + " alt=\"" + alt + "\" src=\"" + hrequest.getContextPath() + "/urlstat/urlStat.do?chartType=" + chartType + "&" + queryStr + "\">";

        JspWriter writer = pageContext.getOut();
        try
        {
            writer.write(img);
        }
        catch(1.5.0/docs/api/java/lang/Exception.html">Exception e)
        {
            logger.error(e,e);
            throw new JspException(e);
        }

        return (SKIP_BODY);
    }
}