geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r385750 [2/5] - in /geronimo/specs/branches/jee5_exp: ./ geronimo-spec-servlet/ geronimo-spec-servlet/src/ geronimo-spec-servlet/src/main/ geronimo-spec-servlet/src/main/java/ geronimo-spec-servlet/src/main/java/javax/ geronimo-spec-servlet...
Date Tue, 14 Mar 2006 07:05:43 GMT
Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServlet.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServlet.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServlet.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServlet.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,512 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Method;
+import java.text.MessageFormat;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.servlet.GenericServlet;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public abstract class HttpServlet extends GenericServlet implements
+        Serializable {
+    // portions copied from the 2.4 impl @ geronimo
+    private static final String METHOD_DELETE = "DELETE";
+    private static final String METHOD_HEAD = "HEAD";
+    private static final String METHOD_GET = "GET";
+    private static final String METHOD_OPTIONS = "OPTIONS";
+    private static final String METHOD_POST = "POST";
+    private static final String METHOD_PUT = "PUT";
+    private static final String METHOD_TRACE = "TRACE";
+
+    private static final String HEADER_IFMODSINCE = "If-Modified-Since";
+    private static final String HEADER_LASTMOD = "Last-Modified";
+    private static final String LOCALIZATION_FILE = "javax.servlet.http.LocalStrings";
+    private static ResourceBundle localeStrings = ResourceBundle
+            .getBundle(LOCALIZATION_FILE);
+
+    public HttpServlet() {
+    }
+
+    protected void doDelete(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        String msg = localeStrings.getString("http.method_get_not_supported");
+        String protocol = req.getProtocol();
+        if (protocol.endsWith("1.1")) {
+            res.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+        } else {
+            res.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+        }
+    }
+
+    protected void doGet(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        String msg = localeStrings.getString("http.method_get_not_supported");
+        String protocol = req.getProtocol();
+        if (protocol.endsWith("1.1")) {
+            res.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+        } else {
+            res.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+        }
+    }
+
+    protected void doHead(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        NoBodyResponse response = new NoBodyResponse(res);
+
+        doGet(req, response);
+        response.setContentLength();
+    }
+
+    protected void doOptions(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        Method[] methods = getAllDeclaredMethods(this.getClass());
+
+        boolean ALLOW_GET = false;
+        boolean ALLOW_HEAD = false;
+        boolean ALLOW_POST = false;
+        boolean ALLOW_PUT = false;
+        boolean ALLOW_DELETE = false;
+        boolean ALLOW_TRACE = true;
+        boolean ALLOW_OPTIONS = true;
+
+        for (int i = 0; i < methods.length; i++) {
+            Method m = methods[i];
+
+            if (m.getName().equals("doGet")) {
+                ALLOW_GET = true;
+                ALLOW_HEAD = true;
+            }
+            if (m.getName().equals("doPost"))
+                ALLOW_POST = true;
+            if (m.getName().equals("doPut"))
+                ALLOW_PUT = true;
+            if (m.getName().equals("doDelete"))
+                ALLOW_DELETE = true;
+        }
+
+        String allow = null;
+        if (ALLOW_GET)
+            if (allow == null)
+                allow = METHOD_GET;
+        if (ALLOW_HEAD)
+            if (allow == null)
+                allow = METHOD_HEAD;
+            else
+                allow += ", " + METHOD_HEAD;
+        if (ALLOW_POST)
+            if (allow == null)
+                allow = METHOD_POST;
+            else
+                allow += ", " + METHOD_POST;
+        if (ALLOW_PUT)
+            if (allow == null)
+                allow = METHOD_PUT;
+            else
+                allow += ", " + METHOD_PUT;
+        if (ALLOW_DELETE)
+            if (allow == null)
+                allow = METHOD_DELETE;
+            else
+                allow += ", " + METHOD_DELETE;
+        if (ALLOW_TRACE)
+            if (allow == null)
+                allow = METHOD_TRACE;
+            else
+                allow += ", " + METHOD_TRACE;
+        if (ALLOW_OPTIONS)
+            if (allow == null)
+                allow = METHOD_OPTIONS;
+            else
+                allow += ", " + METHOD_OPTIONS;
+
+        res.setHeader("Allow", allow);
+    }
+
+    private Method[] getAllDeclaredMethods(Class c) {
+        if (c.getName().equals("javax.servlet.http.HttpServlet"))
+            return null;
+
+        int j = 0;
+        Method[] parentMethods = getAllDeclaredMethods(c.getSuperclass());
+        Method[] thisMethods = c.getDeclaredMethods();
+
+        if (parentMethods != null) {
+            Method[] allMethods = new Method[parentMethods.length
+                    + thisMethods.length];
+            for (int i = 0; i < parentMethods.length; i++) {
+                allMethods[i] = parentMethods[i];
+                j = i;
+            }
+            j++;
+            for (int i = j; i < thisMethods.length + j; i++) {
+                allMethods[i] = thisMethods[i - j];
+            }
+            return allMethods;
+        }
+        return thisMethods;
+    }
+
+    protected void doPost(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        String msg = localeStrings.getString("http.method_get_not_supported");
+        String protocol = req.getProtocol();
+        if (protocol.endsWith("1.1")) {
+            res.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+        } else {
+            res.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+        }
+    }
+
+    protected void doPut(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+        String msg = localeStrings.getString("http.method_get_not_supported");
+        String protocol = req.getProtocol();
+        if (protocol.endsWith("1.1")) {
+            res.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+        } else {
+            res.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+        }
+    }
+
+    protected void doTrace(HttpServletRequest req, HttpServletResponse res)
+            throws ServletException, IOException {
+
+        int responseLength;
+
+        String CRLF = "\r\n";
+        String responseString = "TRACE " + req.getRequestURI() + " "
+                + req.getProtocol();
+
+        Enumeration reqHeaderEnum = req.getHeaderNames();
+
+        while (reqHeaderEnum.hasMoreElements()) {
+            String headerName = (String) reqHeaderEnum.nextElement();
+            responseString += CRLF + headerName + ": "
+                    + req.getHeader(headerName);
+        }
+
+        responseString += CRLF;
+
+        responseLength = responseString.length();
+
+        res.setContentType("message/http");
+        res.setContentLength(responseLength);
+        ServletOutputStream out = res.getOutputStream();
+        out.print(responseString);
+        out.close();
+        return;
+    }
+
+    protected long getLastModified(HttpServletRequest req) {
+        return -1;
+    }
+
+    protected void service(HttpServletRequest req, HttpServletResponse resp)
+            throws ServletException, IOException {
+        String method = req.getMethod();
+
+        if (method.equals(METHOD_GET)) {
+            long lastModified = getLastModified(req);
+            if (lastModified == -1) {
+                // servlet doesn't support if-modified-since, no reason
+                // to go through further expensive logic
+                doGet(req, resp);
+            } else {
+                long ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
+                if (ifModifiedSince < (lastModified / 1000 * 1000)) {
+                    // If the servlet mod time is later, call doGet()
+                    // Round down to the nearest second for a proper compare
+                    // A ifModifiedSince of -1 will always be less
+                    maybeSetLastModified(resp, lastModified);
+                    doGet(req, resp);
+                } else {
+                    resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+                }
+            }
+
+        } else if (method.equals(METHOD_HEAD)) {
+            long lastModified = getLastModified(req);
+            maybeSetLastModified(resp, lastModified);
+            doHead(req, resp);
+
+        } else if (method.equals(METHOD_POST)) {
+            doPost(req, resp);
+
+        } else if (method.equals(METHOD_PUT)) {
+            doPut(req, resp);
+
+        } else if (method.equals(METHOD_DELETE)) {
+            doDelete(req, resp);
+
+        } else if (method.equals(METHOD_OPTIONS)) {
+            doOptions(req, resp);
+
+        } else if (method.equals(METHOD_TRACE)) {
+            doTrace(req, resp);
+
+        } else {
+            //
+            // Note that this means NO servlet supports whatever
+            // method was requested, anywhere on this server.
+            //
+
+            String errMsg = localeStrings
+                    .getString("http.method_not_implemented");
+            Object[] errArgs = new Object[1];
+            errArgs[0] = method;
+            errMsg = MessageFormat.format(errMsg, errArgs);
+
+            resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, errMsg);
+        }
+    }
+
+    private void maybeSetLastModified(HttpServletResponse resp,
+            long lastModified) {
+        if (resp.containsHeader(HEADER_LASTMOD))
+            return;
+        if (lastModified >= 0)
+            resp.setDateHeader(HEADER_LASTMOD, lastModified);
+    }
+
+    @Override
+    public void service(ServletRequest req, ServletResponse res)
+            throws ServletException, IOException {
+        HttpServletRequest request;
+        HttpServletResponse response;
+
+        try {
+            request = (HttpServletRequest) req;
+            response = (HttpServletResponse) res;
+        } catch (ClassCastException e) {
+            throw new ServletException("non-HTTP request or response");
+        }
+        service(request, response);
+    }
+
+    // this whole class copied from the 2.4 jar
+    class NoBodyOutputStream extends ServletOutputStream {
+
+        private int contentLength = 0;
+
+        NoBodyOutputStream() {
+        }
+
+        int getContentLength() {
+            return contentLength;
+        }
+
+        public void write(int b) {
+            contentLength++;
+        }
+
+        public void write(byte buf[], int offset, int len) throws IOException {
+            if (len >= 0) {
+                contentLength += len;
+            } else {
+                // XXX
+                // isn't this really an IllegalArgumentException?
+
+                throw new IOException("negative length");
+            }
+        }
+    }
+
+    class NoBodyResponse implements HttpServletResponse {
+        private HttpServletResponse resp;
+        private NoBodyOutputStream noBody;
+        private PrintWriter writer;
+        private boolean didSetContentLength;
+
+        NoBodyResponse(HttpServletResponse r) {
+            resp = r;
+            noBody = new NoBodyOutputStream();
+        }
+
+        void setContentLength() {
+            if (!didSetContentLength) {
+                resp.setContentLength(noBody.getContentLength());
+            }
+        }
+
+        //
+        // SERVLET RESPONSE interface methods
+        //
+
+        public void setContentLength(int len) {
+            resp.setContentLength(len);
+            didSetContentLength = true;
+        }
+
+        public void setCharacterEncoding(String charset) {
+            resp.setCharacterEncoding(charset);
+        }
+
+        public void setContentType(String type) {
+            resp.setContentType(type);
+        }
+
+        public String getContentType() {
+            return resp.getContentType();
+        }
+
+        public ServletOutputStream getOutputStream() throws IOException {
+            return noBody;
+        }
+
+        public String getCharacterEncoding() {
+            return resp.getCharacterEncoding();
+        }
+
+        public PrintWriter getWriter() throws UnsupportedEncodingException {
+            if (writer == null) {
+                OutputStreamWriter w;
+
+                w = new OutputStreamWriter(noBody, getCharacterEncoding());
+                writer = new PrintWriter(w);
+            }
+            return writer;
+        }
+
+        public void setBufferSize(int size) throws IllegalStateException {
+            resp.setBufferSize(size);
+        }
+
+        public int getBufferSize() {
+            return resp.getBufferSize();
+        }
+
+        public void reset() throws IllegalStateException {
+            resp.reset();
+        }
+
+        public void resetBuffer() throws IllegalStateException {
+            resp.resetBuffer();
+        }
+
+        public boolean isCommitted() {
+            return resp.isCommitted();
+        }
+
+        public void flushBuffer() throws IOException {
+            resp.flushBuffer();
+        }
+
+        public void setLocale(Locale loc) {
+            resp.setLocale(loc);
+        }
+
+        public Locale getLocale() {
+            return resp.getLocale();
+        }
+
+        //
+        // HTTP SERVLET RESPONSE interface methods
+        //
+
+        public void addCookie(Cookie cookie) {
+            resp.addCookie(cookie);
+        }
+
+        public boolean containsHeader(String name) {
+            return resp.containsHeader(name);
+        }
+
+        @Deprecated
+        public void setStatus(int sc, String sm) {
+            resp.setStatus(sc, sm);
+        }
+
+        public void setStatus(int sc) {
+            resp.setStatus(sc);
+        }
+
+        public void setHeader(String name, String value) {
+            resp.setHeader(name, value);
+        }
+
+        public void setIntHeader(String name, int value) {
+            resp.setIntHeader(name, value);
+        }
+
+        public void setDateHeader(String name, long date) {
+            resp.setDateHeader(name, date);
+        }
+
+        public void sendError(int sc, String msg) throws IOException {
+            resp.sendError(sc, msg);
+        }
+
+        public void sendError(int sc) throws IOException {
+            resp.sendError(sc);
+        }
+
+        public void sendRedirect(String location) throws IOException {
+            resp.sendRedirect(location);
+        }
+
+        public String encodeURL(String url) {
+            return resp.encodeURL(url);
+        }
+
+        public String encodeRedirectURL(String url) {
+            return resp.encodeRedirectURL(url);
+        }
+
+        public void addHeader(String name, String value) {
+            resp.addHeader(name, value);
+        }
+
+        public void addDateHeader(String name, long value) {
+            resp.addDateHeader(name, value);
+        }
+
+        public void addIntHeader(String name, int value) {
+            resp.addIntHeader(name, value);
+        }
+
+        @Deprecated
+        public String encodeUrl(String url) {
+            return this.encodeURL(url);
+        }
+
+        @Deprecated
+        public String encodeRedirectUrl(String url) {
+            return this.encodeRedirectURL(url);
+        }
+    }
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequest.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequest.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequest.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequest.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.security.Principal;
+import java.util.Enumeration;
+
+import javax.servlet.ServletRequest;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpServletRequest extends ServletRequest {
+    public static final String BASIC_AUTH = "BASIC";
+    public static final String CLIENT_CERT_AUTH = "CLIENT_CERT";
+    public static final String DIGEST_AUTH = "DIGEST";
+    public static final String FORM_AUTH = "FORM";
+
+    public String getAuthType();
+
+    public String getContextPath();
+
+    public Cookie[] getCookies();
+
+    public long getDateHeader(String name);
+
+    public String getHeader(String name);
+
+    public Enumeration getHeaderNames();
+
+    public Enumeration getHeaders(String name);
+
+    public int getIntHeader(String name);
+
+    public String getMethod();
+
+    public String getPathInfo();
+
+    public String getPathTranslated();
+
+    public String getQueryString();
+
+    public String getRemoteUser();
+
+    public String getRequestedSessionId();
+
+    public String getRequestURI();
+
+    public StringBuffer getRequestURL();
+
+    public String getServletPath();
+
+    public HttpSession getSession();
+
+    public HttpSession getSession(boolean create);
+
+    public Principal getUserPrincipal();
+
+    public boolean isRequestedSessionIdFromCookie();
+
+    @Deprecated
+    public boolean isRequestedSessionIdFromUrl();
+
+    public boolean isRequestedSessionIdFromURL();
+
+    public boolean isRequestedSessionIdValid();
+
+    public boolean isUserInRole(String role);
+
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletRequestWrapper.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,154 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.security.Principal;
+import java.util.Enumeration;
+
+import javax.servlet.ServletRequestWrapper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HttpServletRequestWrapper extends ServletRequestWrapper implements
+        HttpServletRequest {
+    private HttpServletRequest request;
+
+    public HttpServletRequestWrapper(HttpServletRequest request) {
+        super(request);
+        this.request = request;
+    }
+
+    public HttpServletRequest getRequest() {
+        return request;
+    }
+
+    public void setRequest(HttpServletRequest request) {
+        super.setRequest(request);
+        this.request = request;
+    }
+
+    public String getAuthType() {
+        return request.getAuthType();
+    }
+
+    public String getContextPath() {
+        return request.getContextPath();
+    }
+
+    public Cookie[] getCookies() {
+        return request.getCookies();
+    }
+
+    public long getDateHeader(String name) {
+        return request.getDateHeader(name);
+    }
+
+    public String getHeader(String name) {
+        return request.getHeader(name);
+    }
+
+    public Enumeration getHeaderNames() {
+        return request.getHeaderNames();
+    }
+
+    public Enumeration getHeaders(String name) {
+        return request.getHeaders(name);
+    }
+
+    public int getIntHeader(String name) {
+        return request.getIntHeader(name);
+    }
+
+    public String getMethod() {
+        return request.getMethod();
+    }
+
+    public String getPathInfo() {
+        return request.getPathInfo();
+    }
+
+    public String getPathTranslated() {
+        return request.getPathTranslated();
+    }
+
+    public String getQueryString() {
+        return request.getQueryString();
+    }
+
+    public String getRemoteUser() {
+        return request.getRemoteUser();
+    }
+
+    public String getRequestedSessionId() {
+        return request.getRequestedSessionId();
+    }
+
+    public String getRequestURI() {
+        return request.getRequestURI();
+    }
+
+    public StringBuffer getRequestURL() {
+        return request.getRequestURL();
+    }
+
+    public String getServletPath() {
+        return request.getServletPath();
+    }
+
+    public HttpSession getSession() {
+        return request.getSession();
+    }
+
+    public HttpSession getSession(boolean create) {
+        return request.getSession(create);
+    }
+
+    public Principal getUserPrincipal() {
+        return request.getUserPrincipal();
+    }
+
+    public boolean isRequestedSessionIdFromCookie() {
+        return request.isRequestedSessionIdFromCookie();
+    }
+
+    @SuppressWarnings("deprecation")
+    public boolean isRequestedSessionIdFromUrl() {
+        // this method is deprecated in the request
+        // but not deprecated in the wrapper - not sure why
+        return request.isRequestedSessionIdFromUrl();
+    }
+
+    public boolean isRequestedSessionIdFromURL() {
+        return request.isRequestedSessionIdFromURL();
+    }
+
+    public boolean isRequestedSessionIdValid() {
+        return request.isRequestedSessionIdValid();
+    }
+
+    public boolean isUserInRole(String role) {
+        return request.isUserInRole(role);
+    }
+
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponse.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponse.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponse.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponse.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.IOException;
+import javax.servlet.ServletResponse;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpServletResponse extends ServletResponse {
+    public static final int SC_ACCEPTED = 202;
+    public static final int SC_BAD_GATEWAY = 502;
+    public static final int SC_BAD_REQUEST = 400;
+    public static final int SC_CONFLICT = 409;
+    public static final int SC_CONTINUE = 100;
+    public static final int SC_CREATED = 201;
+    public static final int SC_EXPECTATION_FAILED = 417;
+    public static final int SC_FORBIDDEN = 403;
+    public static final int SC_FOUND = 302;
+    public static final int SC_GATEWAY_TIMEOUT = 504;
+    public static final int SC_GONE = 410;
+    public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
+    public static final int SC_INTERNAL_SERVER_ERROR = 500;
+    public static final int SC_LENGTH_REQUIRED = 411;
+    public static final int SC_METHOD_NOT_ALLOWED = 405;
+    public static final int SC_MOVED_PERMANENTLY = 301;
+    public static final int SC_MOVED_TEMPORARILY = 302;
+    public static final int SC_MULTIPLE_CHOICES = 300;
+    public static final int SC_NO_CONTENT = 204;
+    public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
+    public static final int SC_NOT_ACCEPTABLE = 406;
+    public static final int SC_NOT_FOUND = 404;
+    public static final int SC_NOT_IMPLEMENTED = 501;
+    public static final int SC_NOT_MODIFIED = 304;
+    public static final int SC_OK = 200;
+    public static final int SC_PARTIAL_CONTENT = 206;
+    public static final int SC_PAYMENT_REQUIRED = 402;
+    public static final int SC_PRECONDITION_FAILED = 412;
+    public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
+    public static final int SC_REQUEST_ENTITY_TOO_LARGE = 413;
+    public static final int SC_REQUEST_TIMEOUT = 408;
+    public static final int SC_REQUEST_URI_TOO_LONG = 414;
+    public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+    public static final int SC_RESET_CONTENT = 205;
+    public static final int SC_SEE_OTHER = 303;
+    public static final int SC_SERVICE_UNAVAILABLE = 503;
+    public static final int SC_SWITCHING_PROTOCOLS = 101;
+    public static final int SC_TEMPORARY_REDIRECT = 307;
+    public static final int SC_UNAUTHORIZED = 401;
+    public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
+    public static final int SC_USE_PROXY = 305;
+
+    public void addCookie(Cookie cookie);
+
+    public void addDateHeader(String name, long date);
+
+    public void addHeader(String name, String value);
+
+    public void addIntHeader(String name, int value);
+
+    public boolean containsHeader(String name);
+
+    @Deprecated
+    public String encodeRedirectUrl(String url);
+
+    public String encodeRedirectURL(String url);
+
+    @Deprecated
+    public String encodeUrl(String url);
+
+    public String encodeURL(String url);
+
+    public void sendError(int errorCode) throws IOException;
+
+    public void sendError(int errorCode, String msg) throws IOException;
+
+    public void sendRedirect(String location) throws IOException;
+
+    public void setDateHeader(String name, long date);
+
+    public void setHeader(String name, String value);
+
+    public void setIntHeader(String name, int value);
+
+    public void setStatus(int statusCode);
+
+    @Deprecated
+    public void setStatus(int statusCode, String statusMessage);
+
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpServletResponseWrapper.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.IOException;
+
+import javax.servlet.ServletResponseWrapper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HttpServletResponseWrapper extends ServletResponseWrapper
+        implements HttpServletResponse {
+    private HttpServletResponse response;
+    public HttpServletResponseWrapper(HttpServletResponse response) {
+        super(response);
+        this.response = response;
+    }
+    
+    public void addCookie(Cookie cookie) {
+        this.response.addCookie(cookie);
+    }
+
+    public void addDateHeader(String name, long date) {
+        this.response.addDateHeader(name, date);
+    }
+
+    public void addHeader(String name, String value) {
+        this.response.addHeader(name, value);
+    }
+
+    public void addIntHeader(String name, int value) {
+        this.response.addIntHeader(name, value);
+    }
+
+    public boolean containsHeader(String name) {
+        return this.response.containsHeader(name);
+    }
+
+    @SuppressWarnings("deprecation")
+    public String encodeRedirectUrl(String url) {
+        return this.response.encodeRedirectUrl(url);
+    }
+
+    public String encodeRedirectURL(String url) {
+        return this.response.encodeRedirectURL(url);
+    }
+
+    @SuppressWarnings("deprecation")
+    public String encodeUrl(String url) {
+        return this.response.encodeUrl(url);
+    }
+
+    public String encodeURL(String url) {
+        return this.response.encodeURL(url);
+    }
+
+    public void sendError(int sc, String msg) throws IOException {
+        this.response.sendError(sc, msg);
+    }
+
+    public void sendError(int sc) throws IOException {
+        this.response.sendError(sc);
+    }
+
+    public void sendRedirect(String location) throws IOException {
+        this.response.sendRedirect(location);
+    }
+
+    public void setDateHeader(String name, long date) {
+        this.response.setDateHeader(name, date);
+    }
+
+    public void setHeader(String name, String value) {
+        this.response.setHeader(name, value);
+    }
+
+    public void setIntHeader(String name, int value) {
+        this.response.setIntHeader(name, value);
+    }
+
+    public void setStatus(int sc) {
+        this.response.setStatus(sc);
+    }
+    
+    @SuppressWarnings("deprecation")
+    public void setStatus(int sc, String sm) {
+        this.response.setStatus(sc, sm);
+    }
+
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSession.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSession.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSession.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSession.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.Enumeration;
+import javax.servlet.ServletContext;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpSession {
+    public Object getAttribute(String name);
+
+    public Enumeration getAttributeNames();
+
+    public long getCreationTime();
+
+    public String getId();
+
+    public long getLastAccessedTime();
+
+    public int getMaxInactiveInterval();
+
+    public ServletContext getServletContext();
+
+    @Deprecated
+    public HttpSessionContext getSessionContext();
+
+    @Deprecated
+    public Object getValue(String name);
+
+    @Deprecated
+    public String[] getValueNames();
+
+    public void invalidate();
+
+    public boolean isNew();
+
+    @Deprecated
+    public void putValue(String name, Object value);
+
+    public void removeAttribute(String name);
+
+    @Deprecated
+    public void removeValue(String name);
+
+    public void setAttribute(String name, Object value);
+
+    public void setMaxInactiveInterval(int interval);
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionActivationListener.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionActivationListener.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionActivationListener.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionActivationListener.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.EventListener;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpSessionActivationListener extends EventListener {
+    public void sessionDidActivate(HttpSessionEvent se);
+
+    public void sessionWillPassivate(HttpSessionEvent se);
+
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionAttributeListener.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.EventListener;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpSessionAttributeListener extends EventListener {
+    public void attributeAdded(HttpSessionBindingEvent se);
+
+    public void attributeRemoved(HttpSessionBindingEvent se);
+
+    public void attributeReplaced(HttpSessionBindingEvent se);
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingEvent.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.Serializable;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HttpSessionBindingEvent extends HttpSessionEvent implements
+        Serializable {
+    private static final long serialVersionUID = 7308000419984825907L;
+    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 String getName() {
+        return name;
+    }
+
+    public HttpSession getSession() {
+        return super.getSession();
+    }
+
+    public Object getValue() {
+        return this.value;
+    }
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingListener.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingListener.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingListener.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionBindingListener.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.EventListener;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpSessionBindingListener extends EventListener {
+    public void valueBound(HttpSessionBindingEvent event);
+
+    public void valueUnbound(HttpSessionBindingEvent event);
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionContext.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionContext.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionContext.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionContext.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.Enumeration;
+/**
+ * @version $Revision$ $Date$
+ */
+@Deprecated
+public interface HttpSessionContext {
+    @Deprecated
+    public Enumeration getIds();
+    @Deprecated
+    public HttpSession getSession(String sessionId);
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionEvent.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionEvent.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionEvent.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionEvent.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.Serializable;
+import java.util.EventObject;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HttpSessionEvent extends EventObject implements Serializable {
+    private static final long serialVersionUID = -7622791603672342895L;
+
+    public HttpSessionEvent(HttpSession source) {
+        super(source);
+    }
+
+    public HttpSession getSession() {
+        return (HttpSession) super.getSource();
+    }
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionListener.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionListener.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionListener.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpSessionListener.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.util.EventListener;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface HttpSessionListener extends EventListener {
+    public void sessionCreated(HttpSessionEvent se);
+
+    public void sessionDestroyed(HttpSessionEvent se);
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpUtils.java?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpUtils.java (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/HttpUtils.java Mon Mar 13 23:05:38 2006
@@ -0,0 +1,176 @@
+/*
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ * 
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.servlet.http;
+
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.ResourceBundle;
+import java.util.StringTokenizer;
+import javax.servlet.ServletInputStream;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Deprecated
+public class HttpUtils {
+    private static final String LSTRING_FILE = "javax.servlet.http.LocalStrings";
+    private static ResourceBundle lStrings = ResourceBundle
+            .getBundle(LSTRING_FILE);
+
+    public HttpUtils() {
+    }
+
+    public static StringBuffer getRequestURL(HttpServletRequest req) {
+        // largely copied from servlet 2.4 impl @ geronimo
+        StringBuffer url = new StringBuffer();
+        String scheme = req.getScheme();
+        int port = req.getServerPort();
+        String urlPath = req.getRequestURI();
+
+        url.append(scheme); // http, https
+        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;
+    }
+
+    static public Hashtable parsePostData(int len, ServletInputStream in) {
+        // largely copied from servlet 2.4 impl @ geronimo
+        // TODO: should a length of 0 be an IllegalArgumentException
+
+        if (len <= 0) {
+            return new Hashtable(); // cheap hack to return an empty hash
+        }
+
+        if (in == null) {
+            throw new IllegalArgumentException();
+        }
+
+        //
+        // Make sure we read the entire POSTed body.
+        //
+        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());
+        }
+
+        // XXX we shouldn't assume that the only kind of POST body
+        // is FORM data encoded using ASCII or ISO Latin/1 ... or
+        // that the body should always be treated as FORM data.
+        //
+
+        try {
+            String postedBody = new String(postedBytes, 0, len, "8859_1");
+            return parseQueryString(postedBody);
+        } catch (java.io.UnsupportedEncodingException e) {
+            // XXX function should accept an encoding parameter & throw this
+            // exception. Otherwise throw something expected.
+            throw new IllegalArgumentException(e.getMessage());
+        }
+    }
+
+    static public Hashtable parseQueryString(String s) {
+        // largely copied from servlet 2.4 impl @ geronimo
+        String valArray[] = null;
+
+        if (s == null) {
+            throw new IllegalArgumentException();
+        }
+        Hashtable<String, String[]> ht = new Hashtable<String, String[]>();
+        StringBuffer sb = new StringBuffer();
+        StringTokenizer st = new StringTokenizer(s, "&");
+        while (st.hasMoreTokens()) {
+            String pair = (String) st.nextToken();
+            int pos = pair.indexOf('=');
+            if (pos == -1) {
+                // XXX
+                // should give more detail about the illegal argument
+                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;
+    }
+
+    static private String parseName(String s, StringBuffer 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) {
+                    // XXX
+                    // need to be more specific about illegal arg
+                    throw new IllegalArgumentException();
+                } catch (StringIndexOutOfBoundsException e) {
+                    String rest = s.substring(i);
+                    sb.append(rest);
+                    if (rest.length() == 2)
+                        i++;
+                }
+
+                break;
+            default:
+                sb.append(c);
+                break;
+            }
+        }
+        return sb.toString();
+    }
+}

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/LocalStrings.properties
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/LocalStrings.properties?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/LocalStrings.properties (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/java/javax/servlet/http/LocalStrings.properties Mon Mar 13 23:05:38 2006
@@ -0,0 +1,31 @@
+##
+##
+##   Copyright 2006 The Apache Software Foundation
+##
+##   Licensed under the Apache License, Version 2.0 (the "License");
+##   you may not use this file except in compliance with the License.
+##   You may obtain a copy of the License at
+##
+##       http://www.apache.org/licenses/LICENSE-2.0
+##
+##   Unless required by applicable law or agreed to in writing, software
+##   distributed under the License is distributed on an "AS IS" BASIS,
+##   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##   See the License for the specific language governing permissions and
+##   limitations under the License.
+##
+
+# Default localized string information
+# Localized for Locale en_US
+# copied from the 2.4 jar
+
+err.cookie_name_is_token=Cookie name \"{0}\" is a reserved token
+err.io.negativelength=Negative Length given in write method
+err.io.short_read=Short Read
+
+http.method_not_implemented=Method {0} is not defined in RFC 2068 and is not supported by the Servlet API 
+
+http.method_get_not_supported=HTTP method GET is not supported by this URL
+http.method_post_not_supported=HTTP method POST is not supported by this URL
+http.method_put_not_supported=HTTP method PUT is not supported by this URL
+http.method_delete_not_supported=Http method DELETE is not supported by this URL

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/XMLSchema.dtd
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/XMLSchema.dtd?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/XMLSchema.dtd (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/XMLSchema.dtd Mon Mar 13 23:05:38 2006
@@ -0,0 +1,402 @@
+<!-- DTD for XML Schemas: Part 1: Structures
+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
+<!-- $Rev: 46020 $ $Date: 2004-09-14 06:22:15 -0600 (Tue, 14 Sep 2004) $ -->
+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
+<!-- (which shouldn't differ from this one except for this -->         <!--d-->
+<!-- comment and entity expansions, but just in case) -->              <!--d-->
+<!-- With the exception of cases with multiple namespace
+     prefixes for the XML Schema namespace, any XML document which is
+     not valid per this DTD given redefinitions in its internal subset of the
+     'p' and 's' parameter entities below appropriate to its namespace
+     declaration of the XML Schema namespace is almost certainly not
+     a valid schema. -->
+
+<!-- The simpleType element and its constituent parts
+     are defined in XML Schema: Part 2: Datatypes -->
+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
+
+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
+                         schema document to establish a different
+                         namespace prefix -->
+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
+                         also define %s as the suffix for the appropriate
+                         namespace declaration (e.g. :foo) -->
+<!ENTITY % nds 'xmlns%s;'>
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % schema "%p;schema">
+<!ENTITY % complexType "%p;complexType">
+<!ENTITY % complexContent "%p;complexContent">
+<!ENTITY % simpleContent "%p;simpleContent">
+<!ENTITY % extension "%p;extension">
+<!ENTITY % element "%p;element">
+<!ENTITY % unique "%p;unique">
+<!ENTITY % key "%p;key">
+<!ENTITY % keyref "%p;keyref">
+<!ENTITY % selector "%p;selector">
+<!ENTITY % field "%p;field">
+<!ENTITY % group "%p;group">
+<!ENTITY % all "%p;all">
+<!ENTITY % choice "%p;choice">
+<!ENTITY % sequence "%p;sequence">
+<!ENTITY % any "%p;any">
+<!ENTITY % anyAttribute "%p;anyAttribute">
+<!ENTITY % attribute "%p;attribute">
+<!ENTITY % attributeGroup "%p;attributeGroup">
+<!ENTITY % include "%p;include">
+<!ENTITY % import "%p;import">
+<!ENTITY % redefine "%p;redefine">
+<!ENTITY % notation "%p;notation">
+
+<!-- annotation elements -->
+<!ENTITY % annotation "%p;annotation">
+<!ENTITY % appinfo "%p;appinfo">
+<!ENTITY % documentation "%p;documentation">
+
+<!-- Customisation entities for the ATTLIST of each element type.
+     Define one of these if your schema takes advantage of the
+     anyAttribute='##other' in the schema for schemas -->
+
+<!ENTITY % schemaAttrs ''>
+<!ENTITY % complexTypeAttrs ''>
+<!ENTITY % complexContentAttrs ''>
+<!ENTITY % simpleContentAttrs ''>
+<!ENTITY % extensionAttrs ''>
+<!ENTITY % elementAttrs ''>
+<!ENTITY % groupAttrs ''>
+<!ENTITY % allAttrs ''>
+<!ENTITY % choiceAttrs ''>
+<!ENTITY % sequenceAttrs ''>
+<!ENTITY % anyAttrs ''>
+<!ENTITY % anyAttributeAttrs ''>
+<!ENTITY % attributeAttrs ''>
+<!ENTITY % attributeGroupAttrs ''>
+<!ENTITY % uniqueAttrs ''>
+<!ENTITY % keyAttrs ''>
+<!ENTITY % keyrefAttrs ''>
+<!ENTITY % selectorAttrs ''>
+<!ENTITY % fieldAttrs ''>
+<!ENTITY % includeAttrs ''>
+<!ENTITY % importAttrs ''>
+<!ENTITY % redefineAttrs ''>
+<!ENTITY % notationAttrs ''>
+<!ENTITY % annotationAttrs ''>
+<!ENTITY % appinfoAttrs ''>
+<!ENTITY % documentationAttrs ''>
+
+<!ENTITY % complexDerivationSet "CDATA">
+      <!-- #all or space-separated list drawn from derivationChoice -->
+<!ENTITY % blockSet "CDATA">
+      <!-- #all or space-separated list drawn from
+                      derivationChoice + 'substitution' -->
+
+<!ENTITY % mgs '%all; | %choice; | %sequence;'>
+<!ENTITY % cs '%choice; | %sequence;'>
+<!ENTITY % formValues '(qualified|unqualified)'>
+
+
+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
+
+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
+
+<!-- This is used in part2 -->
+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
+
+%xs-datatypes;
+
+<!-- the duplication below is to produce an unambiguous content model
+     which allows annotation everywhere -->
+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
+                    ((%simpleType; | %complexType;
+                      | %element; | %attribute;
+                      | %attributeGroup; | %group;
+                      | %notation; ),
+                     (%annotation;)*)* )>
+<!ATTLIST %schema;
+   targetNamespace      %URIref;               #IMPLIED
+   version              CDATA                  #IMPLIED
+   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
+   xmlns                CDATA                  #IMPLIED
+   finalDefault         %complexDerivationSet; ''
+   blockDefault         %blockSet;             ''
+   id                   ID                     #IMPLIED
+   elementFormDefault   %formValues;           'unqualified'
+   attributeFormDefault %formValues;           'unqualified'
+   xml:lang             CDATA                  #IMPLIED
+   %schemaAttrs;>
+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
+     because at the Infoset level where schemas operate,
+     xmlns(:prefix) is NOT an attribute! -->
+<!-- The declaration of xmlns is a convenience for schema authors -->
+ 
+<!-- The id attribute here and below is for use in external references
+     from non-schemas using simple fragment identifiers.
+     It is NOT used for schema-to-schema reference, internal or
+     external. -->
+
+<!-- a type is a named content type specification which allows attribute
+     declarations-->
+<!-- -->
+
+<!ELEMENT %complexType; ((%annotation;)?,
+                         (%simpleContent;|%complexContent;|
+                          %particleAndAttrs;))>
+
+<!ATTLIST %complexType;
+          name      %NCName;                        #IMPLIED
+          id        ID                              #IMPLIED
+          abstract  %boolean;                       #IMPLIED
+          final     %complexDerivationSet;          #IMPLIED
+          block     %complexDerivationSet;          #IMPLIED
+          mixed (true|false) 'false'
+          %complexTypeAttrs;>
+
+<!-- particleAndAttrs is shorthand for a root type -->
+<!-- mixed is disallowed if simpleContent, overriden if complexContent
+     has one too. -->
+
+<!-- If anyAttribute appears in one or more referenced attributeGroups
+     and/or explicitly, the intersection of the permissions is used -->
+
+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %complexContent;
+          mixed (true|false) #IMPLIED
+          id    ID           #IMPLIED
+          %complexContentAttrs;>
+
+<!-- restriction should use the branch defined above, not the simple
+     one from part2; extension should use the full model  -->
+
+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %simpleContent;
+          id    ID           #IMPLIED
+          %simpleContentAttrs;>
+
+<!-- restriction should use the simple branch from part2, not the 
+     one defined above; extension should have no particle  -->
+
+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
+<!ATTLIST %extension;
+          base  %QName;      #REQUIRED
+          id    ID           #IMPLIED
+          %extensionAttrs;>
+
+<!-- an element is declared by either:
+ a name and a type (either nested or referenced via the type attribute)
+ or a ref to an existing element declaration -->
+
+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
+                     (%unique; | %key; | %keyref;)*)>
+<!-- simpleType or complexType only if no type|ref attribute -->
+<!-- ref not allowed at top level -->
+<!ATTLIST %element;
+            name               %NCName;               #IMPLIED
+            id                 ID                     #IMPLIED
+            ref                %QName;                #IMPLIED
+            type               %QName;                #IMPLIED
+            minOccurs          %nonNegativeInteger;   #IMPLIED
+            maxOccurs          CDATA                  #IMPLIED
+            nillable           %boolean;              #IMPLIED
+            substitutionGroup  %QName;                #IMPLIED
+            abstract           %boolean;              #IMPLIED
+            final              %complexDerivationSet; #IMPLIED
+            block              %blockSet;             #IMPLIED
+            default            CDATA                  #IMPLIED
+            fixed              CDATA                  #IMPLIED
+            form               %formValues;           #IMPLIED
+            %elementAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- In the absence of type AND ref, type defaults to type of
+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
+<!-- default and fixed are mutually exclusive -->
+
+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
+<!ATTLIST %group; 
+          name        %NCName;               #IMPLIED
+          ref         %QName;                #IMPLIED
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %groupAttrs;>
+
+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
+<!ATTLIST %all;
+          minOccurs   (1)                    #IMPLIED
+          maxOccurs   (1)                    #IMPLIED
+          id          ID                     #IMPLIED
+          %allAttrs;>
+
+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %choice;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %choiceAttrs;>
+
+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %sequence;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %sequenceAttrs;>
+
+<!-- an anonymous grouping in a model, or
+     a top-level named group definition, or a reference to same -->
+
+<!-- Note that if order is 'all', group is not allowed inside.
+     If order is 'all' THIS group must be alone (or referenced alone) at
+     the top level of a content model -->
+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
+<!-- Should allow minOccurs=0 inside order='all' . . . -->
+
+<!ELEMENT %any; (%annotation;)?>
+<!ATTLIST %any;
+            namespace       CDATA                  '##any'
+            processContents (skip|lax|strict)      'strict'
+            minOccurs       %nonNegativeInteger;   '1'
+            maxOccurs       CDATA                  '1'
+            id              ID                     #IMPLIED
+            %anyAttrs;>
+
+<!-- namespace is interpreted as follows:
+                  ##any      - - any non-conflicting WFXML at all
+
+                  ##other    - - any non-conflicting WFXML from namespace other
+                                  than targetNamespace
+
+                  ##local    - - any unqualified non-conflicting WFXML/attribute
+                  one or     - - any non-conflicting WFXML from
+                  more URI        the listed namespaces
+                  references
+
+                  ##targetNamespace ##local may appear in the above list,
+                    with the obvious meaning -->
+
+<!ELEMENT %anyAttribute; (%annotation;)?>
+<!ATTLIST %anyAttribute;
+            namespace       CDATA              '##any'
+            processContents (skip|lax|strict)  'strict'
+            id              ID                 #IMPLIED
+            %anyAttributeAttrs;>
+<!-- namespace is interpreted as for 'any' above -->
+
+<!-- simpleType only if no type|ref attribute -->
+<!-- ref not allowed at top level, name iff at top level -->
+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
+<!ATTLIST %attribute;
+          name      %NCName;      #IMPLIED
+          id        ID            #IMPLIED
+          ref       %QName;       #IMPLIED
+          type      %QName;       #IMPLIED
+          use       (prohibited|optional|required) #IMPLIED
+          default   CDATA         #IMPLIED
+          fixed     CDATA         #IMPLIED
+          form      %formValues;  #IMPLIED
+          %attributeAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- default for use is optional when nested, none otherwise -->
+<!-- default and fixed are mutually exclusive -->
+<!-- type attr and simpleType content are mutually exclusive -->
+
+<!-- an attributeGroup is a named collection of attribute decls, or a
+     reference thereto -->
+<!ELEMENT %attributeGroup; ((%annotation;)?,
+                       (%attribute; | %attributeGroup;)*,
+                       (%anyAttribute;)?) >
+<!ATTLIST %attributeGroup;
+                 name       %NCName;       #IMPLIED
+                 id         ID             #IMPLIED
+                 ref        %QName;        #IMPLIED
+                 %attributeGroupAttrs;>
+
+<!-- ref iff no content, no name.  ref iff not top level -->
+
+<!-- better reference mechanisms -->
+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %unique;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %uniqueAttrs;>
+
+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %key;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyAttrs;>
+
+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %keyref;
+          name     %NCName;       #REQUIRED
+	  refer    %QName;        #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyrefAttrs;>
+
+<!ELEMENT %selector; ((%annotation;)?)>
+<!ATTLIST %selector;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %selectorAttrs;>
+<!ELEMENT %field; ((%annotation;)?)>
+<!ATTLIST %field;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %fieldAttrs;>
+
+<!-- Schema combination mechanisms -->
+<!ELEMENT %include; (%annotation;)?>
+<!ATTLIST %include;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %includeAttrs;>
+
+<!ELEMENT %import; (%annotation;)?>
+<!ATTLIST %import;
+          namespace      %URIref; #IMPLIED
+          schemaLocation %URIref; #IMPLIED
+          id             ID       #IMPLIED
+          %importAttrs;>
+
+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
+                      %attributeGroup; | %group;)*>
+<!ATTLIST %redefine;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %redefineAttrs;>
+
+<!ELEMENT %notation; (%annotation;)?>
+<!ATTLIST %notation;
+	  name        %NCName;    #REQUIRED
+	  id          ID          #IMPLIED
+	  public      CDATA       #REQUIRED
+	  system      %URIref;    #IMPLIED
+	  %notationAttrs;>
+
+<!-- Annotation is either application information or documentation -->
+<!-- By having these here they are available for datatypes as well
+     as all the structures elements -->
+
+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
+<!ATTLIST %annotation; %annotationAttrs;>
+
+<!-- User must define annotation elements in internal subset for this
+     to work -->
+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
+<!ATTLIST %appinfo;
+          source     %URIref;      #IMPLIED
+          id         ID         #IMPLIED
+          %appinfoAttrs;>
+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
+<!ATTLIST %documentation;
+          source     %URIref;   #IMPLIED
+          id         ID         #IMPLIED
+          xml:lang   CDATA      #IMPLIED
+          %documentationAttrs;>
+
+<!NOTATION XMLSchemaStructures PUBLIC
+           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
+<!NOTATION XML PUBLIC
+           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >

Added: geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/datatypes.dtd
URL: http://svn.apache.org/viewcvs/geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/datatypes.dtd?rev=385750&view=auto
==============================================================================
--- geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/datatypes.dtd (added)
+++ geronimo/specs/branches/jee5_exp/geronimo-spec-servlet/src/main/resources/javax/servlet/resources/datatypes.dtd Mon Mar 13 23:05:38 2006
@@ -0,0 +1,204 @@
+<!--
+        DTD for XML Schemas: Part 2: Datatypes
+        Note this DTD is NOT normative, or even definitive. - - the
+        prose copy in the datatypes REC is the definitive version
+        (which shouldn't differ from this one except for this comment
+        and entity expansions, but just in case)
+
+        $Rev: 46020 $ $Date: 2004-09-14 06:22:15 -0600 (Tue, 14 Sep 2004) $
+  -->
+
+<!--
+        This DTD cannot be used on its own, it is intended
+        only for incorporation in XMLSchema.dtd, q.v.
+  -->
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % simpleType "%p;simpleType">
+<!ENTITY % restriction "%p;restriction">
+<!ENTITY % list "%p;list">
+<!ENTITY % union "%p;union">
+<!ENTITY % maxExclusive "%p;maxExclusive">
+<!ENTITY % minExclusive "%p;minExclusive">
+<!ENTITY % maxInclusive "%p;maxInclusive">
+<!ENTITY % minInclusive "%p;minInclusive">
+<!ENTITY % totalDigits "%p;totalDigits">
+<!ENTITY % fractionDigits "%p;fractionDigits">
+<!ENTITY % length "%p;length">
+<!ENTITY % minLength "%p;minLength">
+<!ENTITY % maxLength "%p;maxLength">
+<!ENTITY % enumeration "%p;enumeration">
+<!ENTITY % whiteSpace "%p;whiteSpace">
+<!ENTITY % pattern "%p;pattern">
+
+<!--
+        Customisation entities for the ATTLIST of each element
+        type. Define one of these if your schema takes advantage
+        of the anyAttribute='##other' in the schema for schemas
+  -->
+
+<!ENTITY % simpleTypeAttrs "">
+<!ENTITY % restrictionAttrs "">
+<!ENTITY % listAttrs "">
+<!ENTITY % unionAttrs "">
+<!ENTITY % maxExclusiveAttrs "">
+<!ENTITY % minExclusiveAttrs "">
+<!ENTITY % maxInclusiveAttrs "">
+<!ENTITY % minInclusiveAttrs "">
+<!ENTITY % totalDigitsAttrs "">
+<!ENTITY % fractionDigitsAttrs "">
+<!ENTITY % lengthAttrs "">
+<!ENTITY % minLengthAttrs "">
+<!ENTITY % maxLengthAttrs "">
+<!ENTITY % enumerationAttrs "">
+<!ENTITY % whiteSpaceAttrs "">
+<!ENTITY % patternAttrs "">
+
+<!-- Define some entities for informative use as attribute
+        types -->
+<!ENTITY % URIref "CDATA">
+<!ENTITY % XPathExpr "CDATA">
+<!ENTITY % QName "NMTOKEN">
+<!ENTITY % QNames "NMTOKENS">
+<!ENTITY % NCName "NMTOKEN">
+<!ENTITY % nonNegativeInteger "NMTOKEN">
+<!ENTITY % boolean "(true|false)">
+<!ENTITY % simpleDerivationSet "CDATA">
+<!--
+        #all or space-separated list drawn from derivationChoice
+  -->
+
+<!--
+        Note that the use of 'facet' below is less restrictive
+        than is really intended:  There should in fact be no
+        more than one of each of minInclusive, minExclusive,
+        maxInclusive, maxExclusive, totalDigits, fractionDigits,
+        length, maxLength, minLength within datatype,
+        and the min- and max- variants of Inclusive and Exclusive
+        are mutually exclusive. On the other hand,  pattern and
+        enumeration may repeat.
+  -->
+<!ENTITY % minBound "(%minInclusive; | %minExclusive;)">
+<!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)">
+<!ENTITY % bounds "%minBound; | %maxBound;">
+<!ENTITY % numeric "%totalDigits; | %fractionDigits;">
+<!ENTITY % ordered "%bounds; | %numeric;">
+<!ENTITY % unordered
+   "%pattern; | %enumeration; | %whiteSpace; | %length; |
+   %maxLength; | %minLength;">
+<!ENTITY % facet "%ordered; | %unordered;">
+<!ENTITY % facetAttr 
+        "value CDATA #REQUIRED
+        id ID #IMPLIED">
+<!ENTITY % fixedAttr "fixed %boolean; #IMPLIED">
+<!ENTITY % facetModel "(%annotation;)?">
+<!ELEMENT %simpleType;
+        ((%annotation;)?, (%restriction; | %list; | %union;))>
+<!ATTLIST %simpleType;
+    name      %NCName; #IMPLIED
+    final     %simpleDerivationSet; #IMPLIED
+    id        ID       #IMPLIED
+    %simpleTypeAttrs;>
+<!-- name is required at top level -->
+<!ELEMENT %restriction; ((%annotation;)?,
+                         (%restriction1; |
+                          ((%simpleType;)?,(%facet;)*)),
+                         (%attrDecls;))>
+<!ATTLIST %restriction;
+    base      %QName;                  #IMPLIED
+    id        ID       #IMPLIED
+    %restrictionAttrs;>
+<!--
+        base and simpleType child are mutually exclusive,
+        one is required.
+
+        restriction is shared between simpleType and
+        simpleContent and complexContent (in XMLSchema.xsd).
+        restriction1 is for the latter cases, when this
+        is restricting a complex type, as is attrDecls.
+  -->
+<!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)>
+<!ATTLIST %list;
+    itemType      %QName;             #IMPLIED
+    id        ID       #IMPLIED
+    %listAttrs;>
+<!--
+        itemType and simpleType child are mutually exclusive,
+        one is required
+  -->
+<!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)>
+<!ATTLIST %union;
+    id            ID       #IMPLIED
+    memberTypes   %QNames;            #IMPLIED
+    %unionAttrs;>
+<!--
+        At least one item in memberTypes or one simpleType
+        child is required
+  -->
+
+<!ELEMENT %maxExclusive; %facetModel;>
+<!ATTLIST %maxExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxExclusiveAttrs;>
+<!ELEMENT %minExclusive; %facetModel;>
+<!ATTLIST %minExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minExclusiveAttrs;>
+
+<!ELEMENT %maxInclusive; %facetModel;>
+<!ATTLIST %maxInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxInclusiveAttrs;>
+<!ELEMENT %minInclusive; %facetModel;>
+<!ATTLIST %minInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minInclusiveAttrs;>
+
+<!ELEMENT %totalDigits; %facetModel;>
+<!ATTLIST %totalDigits;
+        %facetAttr;
+        %fixedAttr;
+        %totalDigitsAttrs;>
+<!ELEMENT %fractionDigits; %facetModel;>
+<!ATTLIST %fractionDigits;
+        %facetAttr;
+        %fixedAttr;
+        %fractionDigitsAttrs;>
+
+<!ELEMENT %length; %facetModel;>
+<!ATTLIST %length;
+        %facetAttr;
+        %fixedAttr;
+        %lengthAttrs;>
+<!ELEMENT %minLength; %facetModel;>
+<!ATTLIST %minLength;
+        %facetAttr;
+        %fixedAttr;
+        %minLengthAttrs;>
+<!ELEMENT %maxLength; %facetModel;>
+<!ATTLIST %maxLength;
+        %facetAttr;
+        %fixedAttr;
+        %maxLengthAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %enumeration; %facetModel;>
+<!ATTLIST %enumeration;
+        %facetAttr;
+        %enumerationAttrs;>
+
+<!ELEMENT %whiteSpace; %facetModel;>
+<!ATTLIST %whiteSpace;
+        %facetAttr;
+        %fixedAttr;
+        %whiteSpaceAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %pattern; %facetModel;>
+<!ATTLIST %pattern;
+        %facetAttr;
+        %patternAttrs;>



Mime
View raw message