javax.servlet_3.0.0.v201112011016

er.getResponse();
  }
  
  public void addCookie(Cookie cookie)
  {
    _getHttpServletResponse().addCookie(cookie);
  }
  
  public boolean containsHeader(String name)
  {
    return _getHttpServletResponse().containsHeader(name);
  }
  
  public String encodeURL(String url)
  {
    return _getHttpServletResponse().encodeURL(url);
  }
  
  public String encodeRedirectURL(String url)
  {
    return _getHttpServletResponse().encodeRedirectURL(url);
  }
  
  /**
   * @deprecated
   */
  public String encodeUrl(String url)
  {
    return _getHttpServletResponse().encodeUrl(url);
  }
  
  /**
   * @deprecated
   */
  public String encodeRedirectUrl(String url)
  {
    return _getHttpServletResponse().encodeRedirectUrl(url);
  }
  
  public void sendError(int sc, String msg)
    throws IOException
  {
    _getHttpServletResponse().sendError(sc, msg);
  }
  
  public void sendError(int sc)
    throws IOException
  {
    _getHttpServletResponse().sendError(sc);
  }
  
  public void sendRedirect(String location)
    throws IOException
  {
    _getHttpServletResponse().sendRedirect(location);
  }
  
  public void setDateHeader(String name, long date)
  {
    _getHttpServletResponse().setDateHeader(name, date);
  }
  
  public void addDateHeader(String name, long date)
  {
    _getHttpServletResponse().addDateHeader(name, date);
  }
  
  public void setHeader(String name, String value)
  {
    _getHttpServletResponse().setHeader(name, value);
  }
  
  public void addHeader(String name, String value)
  {
    _getHttpServletResponse().addHeader(name, value);
  }
  
  public void setIntHeader(String name, int value)
  {
    _getHttpServletResponse().setIntHeader(name, value);
  }
  
  public void addIntHeader(String name, int value)
  {
    _getHttpServletResponse().addIntHeader(name, value);
  }
  
  public void setStatus(int sc)
  {
    _getHttpServletResponse().setStatus(sc);
  }
  
  /**
   * @deprecated
   */
  public void setStatus(int sc, String sm)
  {
    _getHttpServletResponse().setStatus(sc, sm);
  }
  
  public int getStatus()
  {
    return _getHttpServletResponse().getStatus();
  }
  
  public String getHeader(String name)
  {
    return _getHttpServletResponse().getHeader(name);
  }
  
  public Collection<String> getHeaders(String name)
  {
    return _getHttpServletResponse().getHeaders(name);
  }
  
  public Collection<String> getHeaderNames()
  {
    return _getHttpServletResponse().getHeaderNames();
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpServletResponseWrapper
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.Enumeration;
import javax.servlet.ServletContext;

public abstract interface HttpSession
{
  public abstract long getCreationTime();
  
  public abstract String getId();
  
  public abstract long getLastAccessedTime();
  
  public abstract ServletContext getServletContext();
  
  public abstract void setMaxInactiveInterval(int paramInt);
  
  public abstract int getMaxInactiveInterval();
  
  /**
   * @deprecated
   */
  public abstract HttpSessionContext getSessionContext();
  
  public abstract Object getAttribute(String paramString);
  
  /**
   * @deprecated
   */
  public abstract Object getValue(String paramString);
  
  public abstract Enumeration<String> getAttributeNames();
  
  /**
   * @deprecated
   */
  public abstract String[] getValueNames();
  
  public abstract void setAttribute(String paramString, Object paramObject);
  
  /**
   * @deprecated
   */
  public abstract void putValue(String paramString, Object paramObject);
  
  public abstract void removeAttribute(String paramString);
  
  /**
   * @deprecated
   */
  public abstract void removeValue(String paramString);
  
  public abstract void invalidate();
  
  public abstract boolean isNew();
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSession
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.EventListener;

public abstract interface HttpSessionActivationListener
  extends EventListener
{
  public abstract void sessionWillPassivate(HttpSessionEvent paramHttpSessionEvent);
  
  public abstract void sessionDidActivate(HttpSessionEvent paramHttpSessionEvent);
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionActivationListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.EventListener;

public abstract interface HttpSessionAttributeListener
  extends EventListener
{
  public abstract void attributeAdded(HttpSessionBindingEvent paramHttpSessionBindingEvent);
  
  public abstract void attributeRemoved(HttpSessionBindingEvent paramHttpSessionBindingEvent);
  
  public abstract void attributeReplaced(HttpSessionBindingEvent paramHttpSessionBindingEvent);
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionAttributeListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

public class HttpSessionBindingEvent
  extends HttpSessionEvent
{
  private String name;
  private Object value;
  
  public HttpSessionBindingEvent(HttpSession session, String name)
  {
    super(session);
    this.name = name;
  }
  
  public HttpSessionBindingEvent(HttpSession session, String name, Object value)
  {
    super(session);
    this.name = name;
    this.value = value;
  }
  
  public HttpSession getSession()
  {
    return super.getSession();
  }
  
  public String getName()
  {
    return name;
  }
  
  public Object getValue()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionBindingEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.EventListener;

public abstract interface HttpSessionBindingListener
  extends EventListener
{
  public abstract void valueBound(HttpSessionBindingEvent paramHttpSessionBindingEvent);
  
  public abstract void valueUnbound(HttpSessionBindingEvent paramHttpSessionBindingEvent);
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionBindingListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.Enumeration;

/**
 * @deprecated
 */
public abstract interface HttpSessionContext
{
  /**
   * @deprecated
   */
  public abstract HttpSession getSession(String paramString);
  
  /**
   * @deprecated
   */
  public abstract Enumeration<String> getIds();
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionContext
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.EventObject;

public class HttpSessionEvent
  extends EventObject
{
  public HttpSessionEvent(HttpSession source)
  {
    super(source);
  }
  
  public HttpSession getSession()
  {
    return (HttpSession)super.getSource();
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionEvent
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.util.EventListener;

public abstract interface HttpSessionListener
  extends EventListener
{
  public abstract void sessionCreated(HttpSessionEvent paramHttpSessionEvent);
  
  public abstract void sessionDestroyed(HttpSessionEvent paramHttpSessionEvent);
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpSessionListener
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Hashtable;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.servlet.ServletInputStream;

/**
 * @deprecated
 */
public class HttpUtils
{
  private static final String LSTRING_FILE = "javax.servlet.http.LocalStrings";
  private static ResourceBundle lStrings = ResourceBundle.getBundle("javax.servlet.http.LocalStrings");
  
  public static Hashtable<String, String[]> parseQueryString(String s)
  {
    String[] valArray = null;
    if (s == null) {
      throw new IllegalArgumentException();
    }
    Hashtable<String, String[]> ht = new Hashtable();
    StringBuilder sb = new StringBuilder();
    StringTokenizer st = new StringTokenizer(s, "&");
    while (st.hasMoreTokens())
    {
      String pair = st.nextToken();
      int pos = pair.indexOf('=');
      if (pos == -1) {
        throw new IllegalArgumentException();
      }
      String key = parseName(pair.substring(0, pos), sb);
      String val = parseName(pair.substring(pos + 1, pair.length()), sb);
      if (ht.containsKey(key))
      {
        String[] oldVals = (String[])ht.get(key);
        valArray = new String[oldVals.length + 1];
        for (int i = 0; i < oldVals.length; i++) {
          valArray[i] = oldVals[i];
        }
        valArray[oldVals.length] = val;
      }
      else
      {
        valArray = new String[1];
        valArray[0] = val;
      }
      ht.put(key, valArray);
    }
    return ht;
  }
  
  public static Hashtable<String, String[]> parsePostData(int len, ServletInputStream in)
  {
    if (len <= 0) {
      return new Hashtable();
    }
    if (in == null) {
      throw new IllegalArgumentException();
    }
    byte[] postedBytes = new byte[len];
    try
    {
      int offset = 0;
      do
      {
        int inputLen = in.read(postedBytes, offset, len - offset);
        if (inputLen <= 0)
        {
          String msg = lStrings.getString("err.io.short_read");
          throw new IllegalArgumentException(msg);
        }
        offset += inputLen;
      } while (len - offset > 0);
    }
    catch (IOException e)
    {
      throw new IllegalArgumentException(e.getMessage());
    }
    try
    {
      String postedBody = new String(postedBytes, 0, len, "8859_1");
      return parseQueryString(postedBody);
    }
    catch (UnsupportedEncodingException e)
    {
      throw new IllegalArgumentException(e.getMessage());
    }
  }
  
  private static String parseName(String s, StringBuilder sb)
  {
    sb.setLength(0);
    for (int i = 0; i < s.length(); i++)
    {
      char c = s.charAt(i);
      switch (c)
      {
      case '+': 
        sb.append(' ');
        break;
      case '%': 
        try
        {
          sb.append((char)Integer.parseInt(s.substring(i + 1, i + 3), 16));
          
          i += 2;
        }
        catch (NumberFormatException e)
        {
          throw new IllegalArgumentException();
        }
        catch (StringIndexOutOfBoundsException e)
        {
          String rest = s.substring(i);
          sb.append(rest);
          if (rest.length() == 2) {
            i++;
          }
        }
      default: 
        sb.append(c);
      }
    }
    return sb.toString();
  }
  
  public static StringBuffer getRequestURL(HttpServletRequest req)
  {
    StringBuffer url = new StringBuffer();
    String scheme = req.getScheme();
    int port = req.getServerPort();
    String urlPath = req.getRequestURI();
    
    url.append(scheme);
    url.append("://");
    url.append(req.getServerName());
    if (((scheme.equals("http")) && (port != 80)) || ((scheme.equals("https")) && (port != 443)))
    {
      url.append(':');
      url.append(req.getServerPort());
    }
    url.append(urlPath);
    
    return url;
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.HttpUtils
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.io.IOException;
import java.util.ResourceBundle;
import javax.servlet.ServletOutputStream;

class NoBodyOutputStream
  extends ServletOutputStream
{
  private static final String LSTRING_FILE = "javax.servlet.http.LocalStrings";
  private static ResourceBundle lStrings = ResourceBundle.getBundle("javax.servlet.http.LocalStrings");
  private int contentLength = 0;
  
  int getContentLength()
  {
    return contentLength;
  }
  
  public void write(int b)
  {
    contentLength += 1;
  }
  
  public void write(byte[] buf, int offset, int len)
    throws IOException
  {
    if (len >= 0) {
      contentLength += len;
    } else {
      throw new IOException(lStrings.getString("err.io.negativelength"));
    }
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.NoBodyOutputStream
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.ResourceBundle;
import javax.servlet.ServletOutputStream;

class NoBodyResponse
  extends HttpServletResponseWrapper
{
  private static final ResourceBundle lStrings = ResourceBundle.getBundle("javax.servlet.http.LocalStrings");
  private NoBodyOutputStream noBody;
  private PrintWriter writer;
  private boolean didSetContentLength;
  private boolean usingOutputStream;
  
  NoBodyResponse(HttpServletResponse r)
  {
    super(r);
    noBody = new NoBodyOutputStream();
  }
  
  void setContentLength()
  {
    if (!didSetContentLength)
    {
      if (writer != null) {
        writer.flush();
      }
      setContentLength(noBody.getContentLength());
    }
  }
  
  public void setContentLength(int len)
  {
    super.setContentLength(len);
    didSetContentLength = true;
  }
  
  public ServletOutputStream getOutputStream()
    throws IOException
  {
    if (writer != null) {
      throw new IllegalStateException(lStrings.getString("err.ise.getOutputStream"));
    }
    usingOutputStream = true;
    
    return noBody;
  }
  
  public PrintWriter getWriter()
    throws UnsupportedEncodingException
  {
    if (usingOutputStream) {
      throw new IllegalStateException(lStrings.getString("err.ise.getWriter"));
    }
    if (writer == null)
    {
      OutputStreamWriter w = new OutputStreamWriter(noBody, getCharacterEncoding());
      
      writer = new PrintWriter(w);
    }
    return writer;
  }
}

/* Location:
 * Qualified Name:     javax.servlet.http.NoBodyResponse
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package javax.servlet.http;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;

public abstract interface Part
{
  public abstract InputStream getInputStream()
    throws IOException;
  
  public abstract String getContentType();
  
  public abstract String getName();
  
  public abstract long getSize();
  
  public abstract void write(String paramString)
    throws IOException;
  
  public abstract void delete()
    throws IOException;
  
  public abstract String getHeader(String paramString);
  
  public abstract Collection<String> getHeaders(String paramString);
  
  public abstract Collection<String> getHeaderNames();
}

/* Location:
 * Qualified Name:     javax.servlet.http.Part
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
1 2 3

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd