package com.acme.tag; import com.acme.bean.RemoteLocationManager; import javax.servlet.jsp.tagext.SimpleTagSupport; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; /** * @author Magnus Rydin * Date: 2005-feb-15 * Time: 12:42:10 */ public class RemoteIncludeTag extends SimpleTagSupport { private String location; private int timeout; public void setLocation(String location) { this.location=location; } public void setTimeout(int timeout) { this.timeout=timeout; } public void doTag() throws JspException, IOException { RemoteLocationManager manager=(RemoteLocationManager)this.getJspContext().findAttribute("remoteLocationManager"); this.getJspContext().getOut().write(manager.getLocation(location,timeout*1000).toString()); } }