jon         02/03/04 17:32:34

  Modified:    src/java/org/apache/turbine DynamicURI.java
                        RelativeDynamicURI.java
               src/java/org/apache/turbine/modules/actions LogoutUser.java
               src/java/org/apache/turbine/pipeline DefaultLoginValve.java
                        DefaultTargetValve.java
               src/java/org/apache/turbine/services/rundata
                        DefaultTurbineRunData.java
               src/tool/org/apache/turbine/tool RelativeTemplateLink.java
  Log:
  removed the deprecated use of the Servlet API with regards to sessions
  and url encoding.
  
  turbine-3 now depends on 2.2 and higher.
  
  if someone *really* has a problem with this,
  please let me know and i will back out this commit...
  
  -jon
  
  Revision  Changes    Path
  1.5       +3 -3      jakarta-turbine-3/src/java/org/apache/turbine/DynamicURI.java
  
  Index: DynamicURI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/DynamicURI.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DynamicURI.java   12 Dec 2001 06:36:00 -0000      1.4
  +++ DynamicURI.java   5 Mar 2002 01:32:34 -0000       1.5
  @@ -84,7 +84,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>John McNally</a>
  - * @version $Id: DynamicURI.java,v 1.4 2001/12/12 06:36:00 jmcnally Exp $
  + * @version $Id: DynamicURI.java,v 1.5 2002/03/05 01:32:34 jon Exp $
    */
   public class DynamicURI
   {
  @@ -858,11 +858,11 @@
           {
               if ( this.redirect )
               {
  -                return res.encodeRedirectUrl (output.toString());
  +                return res.encodeRedirectURL (output.toString());
               }
               else
               {
  -                return res.encodeUrl (output.toString());
  +                return res.encodeURL (output.toString());
               }
           }
           else
  
  
  
  1.4       +2 -2      
jakarta-turbine-3/src/java/org/apache/turbine/RelativeDynamicURI.java
  
  Index: RelativeDynamicURI.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/RelativeDynamicURI.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RelativeDynamicURI.java   12 Dec 2001 02:14:41 -0000      1.3
  +++ RelativeDynamicURI.java   5 Mar 2002 01:32:34 -0000       1.4
  @@ -154,9 +154,9 @@
           if ( this.res != null )
           {
               if ( this.redirect )
  -                return res.encodeRedirectUrl (output.toString());
  +                return res.encodeRedirectURL (output.toString());
               else
  -                return res.encodeUrl (output.toString());
  +                return res.encodeURL (output.toString());
           }
           else
           {
  
  
  
  1.3       +2 -2      
jakarta-turbine-3/src/java/org/apache/turbine/modules/actions/LogoutUser.java
  
  Index: LogoutUser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/modules/actions/LogoutUser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LogoutUser.java   1 Sep 2001 16:58:11 -0000       1.2
  +++ LogoutUser.java   5 Mar 2002 01:32:34 -0000       1.3
  @@ -67,7 +67,7 @@
    * the User object in the session.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dave Bryson</a>
  - * @version $Id: LogoutUser.java,v 1.2 2001/09/01 16:58:11 jvanzyl Exp $
  + * @version $Id: LogoutUser.java,v 1.3 2002/03/05 01:32:34 jon Exp $
    */
   public class LogoutUser
       extends Action
  @@ -118,7 +118,7 @@
           // In the event that the current screen or related navigations
           // require acl info, we cannot wait for Turbine to handle
           // regenerating acl.
  -        data.getSession().removeValue(AccessControlList.SESSION_KEY);
  +        data.getSession().removeAttribute(AccessControlList.SESSION_KEY);
   
           // If this action name is the value of action.logout then we are
           // being run before the session validator, so we don't need to
  
  
  
  1.4       +5 -4      
jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java
  
  Index: DefaultLoginValve.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultLoginValve.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultLoginValve.java    24 Jan 2002 03:55:26 -0000      1.3
  +++ DefaultLoginValve.java    5 Mar 2002 01:32:34 -0000       1.4
  @@ -76,7 +76,7 @@
    * cycle.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason van Zyl</a>
  - * @version $Id: DefaultLoginValve.java,v 1.3 2002/01/24 03:55:26 jvanzyl Exp $
  + * @version $Id: DefaultLoginValve.java,v 1.4 2002/03/05 01:32:34 jon Exp $
    */
   public class DefaultLoginValve
       extends AbstractValve
  @@ -148,12 +148,13 @@
               if (data.getAction().equalsIgnoreCase
                   (Turbine.getConfiguration().getString(ACTION_LOGIN)))
               {
  -                String[] names = data.getSession().getValueNames();
  +                Enumeration names = data.getSession().getAttributeNames();
                   if (names != null)
                   {
  -                    for (int i = 0; i < names.length; i++)
  +                    while (names.hasMoreElements())
                       {
  -                        data.getSession().removeValue(names[i]);
  +                        data.getSession()
  +                            .removeAttribute((String)names.nextElement());
                       }
                   }
               }
  
  
  
  1.13      +2 -2      
jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultTargetValve.java
  
  Index: DefaultTargetValve.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/pipeline/DefaultTargetValve.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultTargetValve.java   6 Feb 2002 17:32:52 -0000       1.12
  +++ DefaultTargetValve.java   5 Mar 2002 01:32:34 -0000       1.13
  @@ -82,7 +82,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Mike Haberman</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>James Taylor</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Martin Poeschl</a>
  - * @version $Id: DefaultTargetValve.java,v 1.12 2002/02/06 17:32:52 mpoeschl Exp $
  + * @version $Id: DefaultTargetValve.java,v 1.13 2002/03/05 01:32:34 jon Exp $
    */
   public class DefaultTargetValve
       extends AbstractValve
  @@ -214,7 +214,7 @@
           {
               try
               {
  -                data.getSession().removeValue
  +                data.getSession().removeAttribute
                       (AccessControlList.SESSION_KEY);
               }
               catch (IllegalStateException invalidatedSession)
  
  
  
  1.11      +10 -7     
jakarta-turbine-3/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java
  
  Index: DefaultTurbineRunData.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/services/rundata/DefaultTurbineRunData.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DefaultTurbineRunData.java        26 Jan 2002 19:38:30 -0000      1.10
  +++ DefaultTurbineRunData.java        5 Mar 2002 01:32:34 -0000       1.11
  @@ -97,7 +97,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jon S. Stevens</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Bernie Hoeneisen</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Daniel Rall</a>
  - * @version $Id: DefaultTurbineRunData.java,v 1.10 2002/01/26 19:38:30 jmcnally Exp 
$
  + * @version $Id: DefaultTurbineRunData.java,v 1.11 2002/03/05 01:32:34 jon Exp $
    */
   public class DefaultTurbineRunData
       extends RecyclableSupport
  @@ -597,7 +597,8 @@
           try
           {
               SessionBindingEventProxy proxy =
  -                (SessionBindingEventProxy) session.getValue(User.SESSION_KEY);
  +                (SessionBindingEventProxy) session
  +                .getAttribute(User.SESSION_KEY);
   
               // If the user isn't yet logged in, return null so that
               // the session validator can take the correct action
  @@ -638,7 +639,7 @@
       {
           try
           {
  -            session.removeValue(User.SESSION_KEY);
  +            session.removeAttribute(User.SESSION_KEY);
           }
           catch (Exception e)
           {
  @@ -655,7 +656,7 @@
           try
           {
               AccessControlList acl = (AccessControlList)
  -                session.getValue(AccessControlList.SESSION_KEY);
  +                session.getAttribute(AccessControlList.SESSION_KEY);
   
               // If the acl isn't yet defined, return null
               return (acl == null ? null : acl);
  @@ -676,7 +677,7 @@
       {
           try
           {
  -            session.removeValue(AccessControlList.SESSION_KEY);
  +            session.removeAttribute(AccessControlList.SESSION_KEY);
           }
           catch (Exception e)
           {
  @@ -1081,8 +1082,10 @@
        */
       public void save()
       {
  -        session.putValue(User.SESSION_KEY, new SessionBindingEventProxy(user));
  -        session.putValue(AccessControlList.SESSION_KEY, (Object) acl);
  +        session.setAttribute(
  +            User.SESSION_KEY, new SessionBindingEventProxy(user));
  +        session.setAttribute(
  +            AccessControlList.SESSION_KEY, (Object) acl);
       }
   
       /**
  
  
  
  1.3       +5 -3      
jakarta-turbine-3/src/tool/org/apache/turbine/tool/RelativeTemplateLink.java
  
  Index: RelativeTemplateLink.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-3/src/tool/org/apache/turbine/tool/RelativeTemplateLink.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RelativeTemplateLink.java 3 Sep 2001 02:01:59 -0000       1.2
  +++ RelativeTemplateLink.java 5 Mar 2002 01:32:34 -0000       1.3
  @@ -55,7 +55,7 @@
    */
   
   import javax.servlet.http.HttpServletResponse;
  -import org.apache.turbine.RelativeDynamicURI;
  +import org.apache.turbine.DynamicURI;
   import org.apache.turbine.RunData;
   import org.apache.turbine.services.pull.ApplicationTool;
   
  @@ -70,10 +70,10 @@
    *
    * @author <a href="[EMAIL PROTECTED]">John D. McNally</a>
    * @author see the authors of TemplateLink
  - * @version $Id: RelativeTemplateLink.java,v 1.2 2001/09/03 02:01:59 jvanzyl Exp $
  + * @version $Id: RelativeTemplateLink.java,v 1.3 2002/03/05 01:32:34 jon Exp $
    */
   public class RelativeTemplateLink
  -    extends RelativeDynamicURI
  +    extends DynamicURI
       implements ApplicationTool
   {
       /** the pathinfo key stored in the DynamicURI */
  @@ -88,6 +88,7 @@
        */
       public RelativeTemplateLink()
       {
  +        setRelative(true);
       }
   
       /**
  @@ -98,6 +99,7 @@
       public RelativeTemplateLink(RunData data)
       {
           super(data);
  +        setRelative(true);
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to