You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/11/19 03:11:16 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/action ActionMappings.java ActionServlet.java

craigmcc    00/11/18 18:11:15

  Modified:    src/doc  release.xml
               src/share/org/apache/struts/action ActionMappings.java
                        ActionServlet.java
  Log:
  Pass the current request to the ActionMappings.getUnknown() method so that
  context sensitive decisions can be made.
  
  Revision  Changes    Path
  1.9       +10 -0     jakarta-struts/src/doc/release.xml
  
  Index: release.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/release.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- release.xml	2000/11/06 04:55:13	1.8
  +++ release.xml	2000/11/19 02:11:14	1.9
  @@ -119,6 +119,13 @@
         modifiers removed, and <code>private</code> instance variables
         changed to <code>protected</code>.  This makes it possible to easily
         subclass these tags to provide specialized functionality.</li>
  +  <li>The <code>&lt;form:link&gt;</code> tag has been enhanced to support
  +      a new <code>page</code> attribute that allows you to use
  +      context-relative URIs in a portable manner.</li>
  +  <li>A new <code>&lt;form:html&gt;</code> tag has been created that
  +      renders an HTML <code>&lt;html&gt;</code> element with appropriate
  +      <code>lang</code> and <code>xml:lang</code> attributes, based on the
  +      session stored in the user's session (if there is one).</li>
     </ul>
   
     <p>The following major new features have been added to the
  @@ -185,6 +192,9 @@
         <code>&lt;jsp:include/&gt;</code> call.  Previously, it would mistakenly
         use the original request URI, rather than the included path, to calculate
         which action class to execute.</li>
  +  <li>The <code>ActionMappings.getUnknown()</code> method now takes the current
  +      request as an parameter, so that context-sensitive decisions can be
  +      made.</li>
     </ul>
   
     <p>The following changes and bug fixes to the Digester module
  
  
  
  1.4       +23 -5     jakarta-struts/src/share/org/apache/struts/action/ActionMappings.java
  
  Index: ActionMappings.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappings.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionMappings.java	2000/09/20 04:20:21	1.3
  +++ ActionMappings.java	2000/11/19 02:11:15	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappings.java,v 1.3 2000/09/20 04:20:21 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/09/20 04:20:21 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappings.java,v 1.4 2000/11/19 02:11:15 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/11/19 02:11:15 $
    *
    * ====================================================================
    *
  @@ -66,6 +66,8 @@
   import java.util.Enumeration;
   import java.util.Hashtable;
   import java.util.Vector;
  +import javax.servlet.ServletRequest;
  +import javax.servlet.http.HttpServletRequest;
   
   
   /**
  @@ -73,7 +75,7 @@
    * administered and searched, while hiding the internal implementation.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/09/20 04:20:21 $
  + * @version $Revision: 1.4 $ $Date: 2000/11/19 02:11:15 $
    */
   
   public class ActionMappings {
  @@ -105,8 +107,24 @@
   
       /**
        * Return the Action that should handle unknown request paths, if any.
  +     * The default implementation casts the request to HttpServletRequest
  +     * and calls the corresponding version of this method.
  +     *
  +     * @param request The servlet request we are processing
        */
  -    public ActionMapping getUnknown() {
  +    public ActionMapping getUnknown(ServletRequest request) {
  +
  +        return (getUnknown((HttpServletRequest) request));
  +
  +    }
  +
  +
  +    /**
  +     * Return the Action that should handle unknown request paths, if any.
  +     *
  +     * @param request The servlet request we are processing
  +     */
  +    public ActionMapping getUnknown(HttpServletRequest request) {
   
           if (unknown != null)
               return (unknown);
  
  
  
  1.35      +5 -5      jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- ActionServlet.java	2000/11/18 22:10:55	1.34
  +++ ActionServlet.java	2000/11/19 02:11:15	1.35
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.34 2000/11/18 22:10:55 craigmcc Exp $
  - * $Revision: 1.34 $
  - * $Date: 2000/11/18 22:10:55 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.35 2000/11/19 02:11:15 craigmcc Exp $
  + * $Revision: 1.35 $
  + * $Date: 2000/11/19 02:11:15 $
    *
    * ====================================================================
    *
  @@ -200,7 +200,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.34 $ $Date: 2000/11/18 22:10:55 $
  + * @version $Revision: 1.35 $ $Date: 2000/11/19 02:11:15 $
    */
   
   public class ActionServlet
  @@ -1477,7 +1477,7 @@
   
           ActionMapping mapping = findMapping(path);
           if (mapping == null)
  -            mapping = mappings.getUnknown();
  +            mapping = mappings.getUnknown(request);
           return (mapping);
   
       }