FileDocCategorySizeDatePackage
ZipCodeTag.javaAPI DocExample2259Sun Apr 09 14:26:18 BST 2006com.oreilly.ajax

ZipCodeTag

public class ZipCodeTag extends javax.servlet.jsp.tagext.TagSupport

Fields Summary
private String
zipcodeId
private String
stateId
private String
cityId
private String
url
static String
javaScript
Constructors Summary
Methods Summary
public intdoStartTag()

    try
    {
      pageContext.getOut().print(getJavaScript());
    } catch (IOException e)
    {
      System.out.println("couldn't write JavaScript to jsp" + e.getMessage());
    }
    return SKIP_BODY;
  
public java.lang.StringgetCityId()

    return cityId;
  
private java.lang.StringgetJavaScript()


    
  
    if (javaScript != null)
    {
      return javaScript;
    }
    else
    {
      String tempString = "";
      String outString = "";

      try
      {

        InputStream is = getClass().getResourceAsStream("oreillyajaxtags.js");
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        while ((tempString = br.readLine()) != null)
        {
          outString += tempString;
        }

        outString = outString.replaceAll("stateId", stateId);
        outString = outString.replaceAll("cityId", cityId);
        outString = outString.replaceAll("zipcodeId", zipcodeId);
        outString = outString.replaceAll("urlName", url);
        br.close();
        is.close();
        javaScript = outString;

      } catch (IOException e)
      {
        System.out.println("couldn't get JavaScript from oreillyajaxtags.js"
            + e.getMessage());
      }
    }
    return javaScript;
  
public java.lang.StringgetStateId()

    return stateId;
  
public java.lang.StringgetUrl()

    return url;
  
public java.lang.StringgetZipcodeId()

    return zipcodeId;
  
public voidsetCityId(java.lang.String city)

    this.cityId = city;
  
public voidsetStateId(java.lang.String state)

    this.stateId = state;
  
public voidsetUrl(java.lang.String url)

    this.url = url;
  
public voidsetZipcodeId(java.lang.String zipcodeId)

    this.zipcodeId = zipcodeId;