You are viewing a plain text version of this content. The canonical link for it is here.
Posted to servletapi-dev@jakarta.apache.org by da...@locus.apache.org on 2000/08/17 03:33:14 UTC
cvs commit: jakarta-servletapi/src/share/javax/servlet/http HttpServletRequestWrapper.java HttpServletResponseWrapper.java HttpSessionAttributesListener.java HttpSessionEvent.java HttpSessionListener.java HttpServletRequest.java HttpSessionBindingEvent.java HttpUtils.java
dannyc 00/08/16 18:33:14
Modified: src/share/javax/servlet Tag: SERVLET_23_JSP_12
RequestDispatcher.java Servlet.java
ServletConfig.java ServletRequest.java
src/share/javax/servlet/http Tag: SERVLET_23_JSP_12
HttpServletRequest.java
HttpSessionBindingEvent.java HttpUtils.java
Added: src/share/javax/servlet Tag: SERVLET_23_JSP_12 Config.java
Filter.java FilterConfig.java
ServletContextAttributeEvent.java
ServletContextAttributesListener.java
ServletContextEvent.java
ServletContextListener.java
ServletRequestWrapper.java
ServletResponseWrapper.java
src/share/javax/servlet/http Tag: SERVLET_23_JSP_12
HttpServletRequestWrapper.java
HttpServletResponseWrapper.java
HttpSessionAttributesListener.java
HttpSessionEvent.java HttpSessionListener.java
Log:
Initial checkin of the Servlet 2.3 Public Review Draft classes to
the Servlet 2.3 / JSP 1.2 branch
Revision Changes Path
No revision
No revision
1.1.1.1.4.1 +9 -4 jakarta-servletapi/src/share/javax/servlet/RequestDispatcher.java
Index: RequestDispatcher.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/RequestDispatcher.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- RequestDispatcher.java 2000/04/26 05:22:28 1.1.1.1
+++ RequestDispatcher.java 2000/08/17 01:33:10 1.1.1.1.4.1
@@ -111,8 +111,10 @@
* Uncommitted output in the response buffer is automatically cleared
* before the forward.
*
- * <p>The request and response parameters must be the same
- * objects as were passed to the calling servlet's service method.
+ * <p>The request and response parameters must be either the same
+ * objects as were passed to the calling servlet's service method or be
+ * subclasses of the {@link ServletRequestWrapper} or {@link ServletResponseWrapper} classes
+ * that wrap them.
*
*
* @param request a {@link ServletRequest} object
@@ -148,8 +150,11 @@
* servlet cannot change the response status code or set headers;
* any attempt to make a change is ignored.
*
- * <p>The request and response parameters must be the same
- * objects as were passed to the calling servlet's service method.
+ * <p>The request and response parameters must be either the same
+ * objects as were passed to the calling servlet's service method or be
+ * subclasses of the {@link ServletRequestWrapper} or {@link ServletResponseWrapper} classes
+ * that wrap them.
+ *
*
*
* @param request a {@link ServletRequest} object
1.1.1.1.4.2 +4 -3 jakarta-servletapi/src/share/javax/servlet/Servlet.java
Index: Servlet.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/Servlet.java,v
retrieving revision 1.1.1.1.4.1
retrieving revision 1.1.1.1.4.2
diff -u -r1.1.1.1.4.1 -r1.1.1.1.4.2
--- Servlet.java 2000/08/16 19:53:22 1.1.1.1.4.1
+++ Servlet.java 2000/08/17 01:33:10 1.1.1.1.4.2
@@ -1,6 +1,3 @@
-
-
-
/*
* The Apache Software License, Version 1.1
*
@@ -169,6 +166,10 @@
*
* <p>This method is only called after the servlet's <code>init()</code>
* method has completed successfully.
+ *
+ * <p> The status code of the response always should be set for a servlet
+ * that throws or sends an error.
+ *
*
* <p>Servlets typically run inside multithreaded servlet containers
* that can handle multiple requests concurrently. Developers must
1.1.1.1.4.1 +1 -65 jakarta-servletapi/src/share/javax/servlet/ServletConfig.java
Index: ServletConfig.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/ServletConfig.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- ServletConfig.java 2000/04/26 05:22:28 1.1.1.1
+++ ServletConfig.java 2000/08/17 01:33:10 1.1.1.1.4.1
@@ -69,73 +69,9 @@
* A servlet configuration object used by a servlet container
* used to pass information to a servlet during initialization.
*
- * <p>The configuration information contains initialization parameters,
- * which are a set of name/value pairs, and a {@link ServletContext} object,
- * which gives the servlet information about the server.
- *
- * @author Various
- * @version $Version$
- *
- * @see ServletContext
- *
*/
-public interface ServletConfig {
-
-
-
-
- /**
- * Returns a reference to the {@link ServletContext} in which the servlet
- * is executing.
- *
- *
- * @return a {@link ServletContext} object, used
- * by the servlet to interact with its servlet
- * container
- *
- * @see ServletContext
- *
- */
-
- public ServletContext getServletContext();
-
-
-
-
-
- /**
- * Returns a <code>String</code> containing the value of the
- * named initialization parameter, or <code>null</code> if
- * the parameter does not exist.
- *
- * @param name a <code>String</code> specifying the name
- * of the initialization parameter
- *
- * @return a <code>String</code> containing the value
- * of the initialization parameter
- *
- */
-
- public String getInitParameter(String name);
-
-
-
- /**
- * Returns the names of the servlet's initialization parameters
- * as an <code>Enumeration</code> of <code>String</code> objects,
- * or an empty <code>Enumeration</code> if the servlet has
- * no initialization parameters.
- *
- * @return an <code>Enumeration</code> of <code>String</code>
- * objects containing the names of the servlet's
- * initialization parameters
- *
- *
- *
- */
-
- public Enumeration getInitParameterNames();
+public interface ServletConfig extends Config {
/**
1.1.1.1.4.1 +25 -1 jakarta-servletapi/src/share/javax/servlet/ServletRequest.java
Index: ServletRequest.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/ServletRequest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- ServletRequest.java 2000/04/26 05:22:29 1.1.1.1
+++ ServletRequest.java 2000/08/17 01:33:11 1.1.1.1.4.1
@@ -65,6 +65,7 @@
import java.io.UnsupportedEncodingException;
import java.util.Enumeration;
import java.util.Locale;
+import java.util.Map;
@@ -153,6 +154,20 @@
*/
public String getCharacterEncoding();
+
+ /**
+ * Overrides the name of the character encoding used in the body of this
+ * request. This method must be called prior to reading request parameters
+ * or reading input using getReader().
+ *
+ *
+ * @param a <code>String</code> containing the name of
+ * the chararacter encoding.
+ *
+ */
+
+ public void setCharacterEncoding(String env);
+
@@ -283,7 +298,16 @@
*/
public String[] getParameterValues(String name);
-
+
+ /** Returns a java.util.Map of the parameters of this request.
+ ** Request parameters
+ * are extra information sent with the request. For HTTP servlets,
+ * parameters are contained in the query string or posted form data.
+ *
+ * @return a java.util.Map container parameter names as keys and parameter values as
+ * map values.
+ */
+ public Map getParameterMap();
No revision
No revision
1.1.2.1 +128 -0 jakarta-servletapi/src/share/javax/servlet/Attic/Config.java
1.1.2.1 +115 -0 jakarta-servletapi/src/share/javax/servlet/Attic/Filter.java
1.1.2.1 +106 -0 jakarta-servletapi/src/share/javax/servlet/Attic/FilterConfig.java
1.1.2.1 +102 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletContextAttributeEvent.java
1.1.2.1 +21 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletContextAttributesListener.java
1.1.2.1 +90 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletContextEvent.java
1.1.2.1 +81 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletContextListener.java
1.1.2.1 +393 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletRequestWrapper.java
1.1.2.1 +219 -0 jakarta-servletapi/src/share/javax/servlet/Attic/ServletResponseWrapper.java
No revision
No revision
1.1.1.1.4.1 +19 -1 jakarta-servletapi/src/share/javax/servlet/http/HttpServletRequest.java
Index: HttpServletRequest.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/http/HttpServletRequest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- HttpServletRequest.java 2000/04/26 05:22:30 1.1.1.1
+++ HttpServletRequest.java 2000/08/17 01:33:12 1.1.1.1.4.1
@@ -491,7 +491,25 @@
public String getRequestURI();
-
+ /**
+ *
+ * Reconstructs the URL the client used to make the request.
+ * The returned URL contains a protocol, server name, port
+ * number, and server path, but it does not include query
+ * string parameters.
+ *
+ * <p>Because this method returns a <code>StringBuffer</code>,
+ * not a string, you can modify the URL easily, for example,
+ * to append query parameters.
+ *
+ * <p>This method is useful for creating redirect messages
+ * and for reporting errors.
+ *
+ * @return a <code>StringBuffer</code> object containing
+ * the reconstructed URL
+ *
+ */
+ public StringBuffer getRequestURL();
/**
1.1.1.1.4.1 +47 -26 jakarta-servletapi/src/share/javax/servlet/http/HttpSessionBindingEvent.java
Index: HttpSessionBindingEvent.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/http/HttpSessionBindingEvent.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- HttpSessionBindingEvent.java 2000/04/26 05:22:30 1.1.1.1
+++ HttpSessionBindingEvent.java 2000/08/17 01:33:13 1.1.1.1.4.1
@@ -66,11 +66,13 @@
/**
*
- * Sent to an object that implements
- * {@link HttpSessionBindingListener} when the object is
- * bound to or unbound from the session.
+ * Either Sent to an object that implements
+ * {@link HttpSessionBindingListener} when it is bound or
+ * unbound from a session, or to a {@link HttpSessionAttributesListener}
+ * that has been configured in the deploymewnt descriptor when any attribute is
+ * bound, unbound or replaced in a session.
*
- * <p>The session binds the object by a call to
+ * <p>Yhe session binds the object by a call to
* <code>HttpSession.putValue</code> and unbinds the object
* by a call to <code>HttpSession.removeValue</code>.
*
@@ -78,13 +80,13 @@
*
* @author Various
* @version $Version$
- *
+ * @since v2.3
* @see HttpSession
* @see HttpSessionBindingListener
- *
+ * @see HttpSessionAttributesListener
*/
-public class HttpSessionBindingEvent extends EventObject {
+public class HttpSessionBindingEvent extends HttpSessionEvent {
@@ -93,6 +95,10 @@
private String name;
+ /* The object is being bound or unbound */
+
+ private Object value;
+
/**
@@ -118,6 +124,30 @@
this.name = name;
}
+ /**
+ *
+ * Constructs an event that notifies an object that it
+ * has been bound to or unbound from a session.
+ * To receive the event, the object must implement
+ * {@link HttpSessionBindingListener}.
+ *
+ *
+ *
+ * @param session the session to which the object is bound or unbound
+ *
+ * @param name the name with which the object is bound or unbound
+ *
+ * @see #getName
+ * @see #getSession
+ *
+ */
+
+ public HttpSessionBindingEvent(HttpSession session, String name, Object value) {
+ super(session);
+ this.name = name;
+ this.value = value;
+ }
+
@@ -140,27 +170,18 @@
return name;
}
-
-
-
-
-
/**
- *
- * Returns the session to or from which the object is
- * bound or unbound.
- *
- * @return the session to which the object is
- * bound or from which the object is
- * unbound
- *
- *
- *
- */
+ * Returns the value of the attribute being added, removed or replaced.
+ * If the attribute was added (or bound), this is the value of the attribute. If the attrubute was
+ * removed (or unbound), this is the value of the removed attribute. If the attribute was replaced, this
+ * is the old value of the attribute.
+ *
+ */
+
+ public Object getValue() {
+ return this.value;
+ }
- public HttpSession getSession() {
- return (HttpSession) getSource();
- }
}
1.1.1.1.4.1 +5 -7 jakarta-servletapi/src/share/javax/servlet/http/HttpUtils.java
Index: HttpUtils.java
===================================================================
RCS file: /home/cvs/jakarta-servletapi/src/share/javax/servlet/http/HttpUtils.java,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.4.1
diff -u -r1.1.1.1 -r1.1.1.1.4.1
--- HttpUtils.java 2000/04/26 05:22:31 1.1.1.1
+++ HttpUtils.java 2000/08/17 01:33:13 1.1.1.1.4.1
@@ -67,15 +67,13 @@
import java.util.StringTokenizer;
import java.io.IOException;
-
/**
- * Provides a collection of methods that are useful
- * in writing HTTP servlets.
+ * @deprecated As of Java(tm) Servlet API 2.3.
+ * These methods were only useful
+ * with the default encoding and have been moved
+ * to the request interfaces.
*
- * @author Various
- * @version $Version$
- *
- */
+*/
public class HttpUtils {
No revision
No revision
1.1.2.1 +307 -0 jakarta-servletapi/src/share/javax/servlet/http/Attic/HttpServletRequestWrapper.java
1.1.2.1 +240 -0 jakarta-servletapi/src/share/javax/servlet/http/Attic/HttpServletResponseWrapper.java
1.1.2.1 +79 -0 jakarta-servletapi/src/share/javax/servlet/http/Attic/HttpSessionAttributesListener.java
1.1.2.1 +76 -0 jakarta-servletapi/src/share/javax/servlet/http/Attic/HttpSessionEvent.java
1.1.2.1 +87 -0 jakarta-servletapi/src/share/javax/servlet/http/Attic/HttpSessionListener.java