You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/02/25 19:30:31 UTC

svn commit: r630954 - in /tapestry/tapestry5/trunk: tapestry-core/src/main/java/org/apache/tapestry/internal/services/ tapestry-core/src/main/java/org/apache/tapestry/services/ tapestry-core/src/test/app1/ tapestry-core/src/test/app1/music/ tapestry-co...

Author: hlship
Date: Mon Feb 25 10:30:27 2008
New Revision: 630954

URL: http://svn.apache.org/viewvc?rev=630954&view=rev
Log:
TAPESTRY-2150: Tapestry should recognize pages that are "nested" beneath other pages

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Music.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/MusicDetails.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Music.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/MusicDetails.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/GenericValueEncoderFactory.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderDispatcher.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/Track.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/AppModule.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibrary.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibraryParser.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderDispatcherTest.java
    tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/module.apt

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/GenericValueEncoderFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/GenericValueEncoderFactory.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/GenericValueEncoderFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/GenericValueEncoderFactory.java Mon Feb 25 10:30:27 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -18,8 +18,9 @@
 import org.apache.tapestry.services.ValueEncoderFactory;
 
 /**
- * An implementation of {@link ValueEncoderFactory} that returns a pre-wired instance of
- * {@link ValueEncoder}.
+ * An implementation of {@link ValueEncoderFactory} that returns a pre-wired instance of {@link ValueEncoder}. This is
+ * odd for a factory, because it doesn't actually create the returned instance, just stores it until the encoder is
+ * needed.
  *
  * @param <V>
  */
@@ -35,5 +36,10 @@
     public ValueEncoder<V> create(Class<V> type)
     {
         return _encoder;
+    }
+
+    public static <V> GenericValueEncoderFactory<V> create(ValueEncoder<V> encoder)
+    {
+        return new GenericValueEncoderFactory<V>(encoder);
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderDispatcher.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderDispatcher.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderDispatcher.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderDispatcher.java Mon Feb 25 10:30:27 2008
@@ -22,10 +22,9 @@
 import java.io.IOException;
 
 /**
- * Dispatches incoming requests for render requests. Render requests consist of either just a
- * logical page name (case insensitive) or a logical page name plus additional context. Because of
- * this structure, it take a little bit of work to identify the split point between the page name
- * and the context.
+ * Dispatches incoming requests for render requests. Render requests consist of either just a logical page name (case
+ * insensitive) or a logical page name plus additional context. Because of this structure, it take a little bit of work
+ * to identify the split point between the page name and the context.
  */
 public class PageRenderDispatcher implements Dispatcher
 {
@@ -54,43 +53,44 @@
         // http://.../context (with no trailing slash).
         if (path.equals("")) return false;
 
-        int searchStart = 1;
+        int nextslashx = path.length();
+        String pageName;
+        boolean atEnd = true;
 
         while (true)
         {
-            int nextslashx = path.indexOf('/', searchStart);
+            // TAPESTRY-2150: Look for the longest match, for situations where
+            // you have some overlap between a class name and a package name.
 
-            boolean atEnd = nextslashx < 0;
+            pageName = path.substring(1, nextslashx);
 
-            String pageName = atEnd ? path.substring(1) : path.substring(1, nextslashx);
+            if (_componentClassResolver.isPageName(pageName)) break;
 
-            if (_componentClassResolver.isPageName(pageName))
-            {
-                String[] context = atEnd ? new String[0] : convertActivationContext(path
-                        .substring(nextslashx + 1));
+            nextslashx = path.lastIndexOf('/', nextslashx - 1);
 
-                EventContext activationContext
-                        = new URLEventContext(_contextValueEncoder, context);
+            atEnd = false;
 
-                PageRenderRequestParameters parameters = new PageRenderRequestParameters(pageName, activationContext);
+            if (nextslashx <= 1) return false;
+        }
 
-                _handler.handle(parameters);
 
-                return true;
-            }
+        String[] context = atEnd ? new String[0] : convertActivationContext(path
+                .substring(nextslashx + 1));
 
-            if (atEnd) return false;
+        EventContext activationContext
+                = new URLEventContext(_contextValueEncoder, context);
 
-            // Advance to the next slash within the path.
+        PageRenderRequestParameters parameters = new PageRenderRequestParameters(pageName, activationContext);
 
-            searchStart = nextslashx + 1;
-        }
+        _handler.handle(parameters);
+
+        return true;
     }
 
     /**
-     * Converts the "extra path", the portion after the page name (and after the slash seperating
-     * the page name from the activation context) into an array of strings. LinkFactory and friends
-     * URL encode each value, so we URL decode the value (we assume that page names are "URL safe").
+     * Converts the "extra path", the portion after the page name (and after the slash seperating the page name from the
+     * activation context) into an array of strings. LinkFactory and friends URL encode each value, so we URL decode the
+     * value (we assume that page names are "URL safe").
      *
      * @param extraPath
      * @return

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java Mon Feb 25 10:30:27 2008
@@ -1566,7 +1566,7 @@
                                                     ObjectLocator locator)
     {
         configuration.add(Object.class, locator.autobuild(TypeCoercedValueEncoderFactory.class));
-        configuration.add(String.class, new GenericValueEncoderFactory(new StringValueEncoder()));
+        configuration.add(String.class, GenericValueEncoderFactory.create(new StringValueEncoder()));
         configuration.add(Enum.class, new EnumValueEncoderFactory());
     }
 

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Music.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Music.tml?rev=630954&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Music.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Music.tml Mon Feb 25 10:30:27 2008
@@ -0,0 +1,14 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <h1>Music Library</h1>
+
+    <t:grid source="tracks" row="track" remove="genre,artist,playcount">
+        <t:parameter name="titleCell">
+            <t:pagelink page="music/details" context="track">${track.title}</t:pagelink>
+        </t:parameter>
+        <t:parameter name="ratingcell">
+            <t:outputRating rating="track.rating"/>
+        </t:parameter>
+    </t:grid>
+
+</html>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/MusicDetails.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/MusicDetails.tml?rev=630954&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/MusicDetails.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/music/MusicDetails.tml Mon Feb 25 10:30:27 2008
@@ -0,0 +1,11 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <h1>Track Details</h1>
+
+    <t:beandisplay object="track"/>
+
+    <p>
+        <t:pagelink page="music">Back to music library</t:pagelink>
+    </p>
+
+</html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Mon Feb 25 10:30:27 2008
@@ -1752,4 +1752,19 @@
 
         assertText("message", "");
     }
+
+    /**
+     * TAPESTRY-2150.  Also demonstrates how to add a ValueEncoder for an entity object, to allow seamless encoding of
+     * the entity's id into the URL.
+     */
+    public void nested_page_names()
+    {
+        start("Music Page", "2");
+
+        assertText("activePageName", "Music");
+
+        clickAndWait("link=The Gift");
+
+        assertText("activePageName", "music/Details");
+    }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/Track.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/Track.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/Track.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/Track.java Mon Feb 25 10:30:27 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -14,11 +14,15 @@
 
 package org.apache.tapestry.integration.app1.data;
 
+import org.apache.tapestry.beaneditor.NonVisual;
+
 /**
  * One track from a music library.
  */
 public class Track implements SimpleTrack
 {
+    private Long _id;
+
     private String _album;
 
     private String _artist;
@@ -30,6 +34,17 @@
     private String _title;
 
     private int _rating;
+
+    @NonVisual
+    public Long getId()
+    {
+        return _id;
+    }
+
+    public void setId(Long id)
+    {
+        _id = id;
+    }
 
     public String getTitle()
     {

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Music.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Music.java?rev=630954&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Music.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Music.java Mon Feb 25 10:30:27 2008
@@ -0,0 +1,44 @@
+// Copyright  2008 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.
+
+package org.apache.tapestry.integration.app1.pages;
+
+import org.apache.tapestry.integration.app1.data.Track;
+import org.apache.tapestry.integration.app1.services.MusicLibrary;
+import org.apache.tapestry.ioc.annotations.Inject;
+
+import java.util.List;
+
+public class Music
+{
+    @Inject
+    private MusicLibrary _library;
+
+    private Track _track;
+
+    public List<Track> getTracks()
+    {
+        return _library.getTracks();
+    }
+
+    public Track getTrack()
+    {
+        return _track;
+    }
+
+    public void setTrack(Track track)
+    {
+        _track = track;
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java Mon Feb 25 10:30:27 2008
@@ -62,6 +62,8 @@
     private static final List<Item> ITEMS = CollectionFactory.newList(
             new Item("actionpage", "Action Page", "tests fixture for ActionLink component"),
 
+            new Item("music", "Music Page", "demo handling of edge cases of page naming"),
+
             new Item("PersistentDemo", "Persistent Demo", "storing and clearing persistent properties"),
 
             new Item("ActionViaLinkDemo", "Action via Link Demo", "tests creating an action link explicitly"),

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/MusicDetails.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/MusicDetails.java?rev=630954&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/MusicDetails.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/music/MusicDetails.java Mon Feb 25 10:30:27 2008
@@ -0,0 +1,37 @@
+// Copyright  2008 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.
+
+package org.apache.tapestry.integration.app1.pages.music;
+
+import org.apache.tapestry.integration.app1.data.Track;
+
+public class MusicDetails
+{
+    private Track _track;
+
+    void onActivate(Track track)
+    {
+        _track = track;
+    }
+
+    Object onPassivate()
+    {
+        return _track;
+    }
+
+    public Track getTrack()
+    {
+        return _track;
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/AppModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/AppModule.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/AppModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/AppModule.java Mon Feb 25 10:30:27 2008
@@ -15,7 +15,9 @@
 package org.apache.tapestry.integration.app1.services;
 
 import org.apache.tapestry.TapestryConstants;
+import org.apache.tapestry.ValueEncoder;
 import org.apache.tapestry.integration.app1.data.Track;
+import org.apache.tapestry.internal.services.GenericValueEncoderFactory;
 import org.apache.tapestry.ioc.Configuration;
 import org.apache.tapestry.ioc.MappedConfiguration;
 import org.apache.tapestry.ioc.OrderedConfiguration;
@@ -34,6 +36,7 @@
 import java.lang.annotation.Target;
 import java.net.URL;
 import java.util.List;
+import java.util.Map;
 
 /**
  * I was just dying to see how fast requests are!
@@ -143,8 +146,24 @@
 
         final List<Track> tracks = new MusicLibraryParser(log).parseTracks(library);
 
+        final Map<Long, Track> idToTrack = CollectionFactory.newMap();
+
+        for (Track t : tracks)
+        {
+            idToTrack.put(t.getId(), t);
+        }
+
         return new MusicLibrary()
         {
+            public Track getById(long id)
+            {
+                Track result = idToTrack.get(id);
+
+                if (result != null) return result;
+
+                throw new IllegalArgumentException(String.format("No track with id #%d.", id));
+            }
+
             public List<Track> getTracks()
             {
                 return tracks;
@@ -190,4 +209,27 @@
             }
         };
     }
+
+    public static void contributeValueEncoderSource(MappedConfiguration<Class, ValueEncoderFactory> configuration,
+                                                    final MusicLibrary library)
+    {
+        ValueEncoder<Track> encoder = new ValueEncoder<Track>()
+        {
+            public String toClient(Track value)
+            {
+                return Long.toString(value.getId());
+            }
+
+            public Track toValue(String clientValue)
+            {
+                long id = Long.parseLong(clientValue);
+
+                return library.getById(id);
+            }
+        };
+
+
+        configuration.add(Track.class, GenericValueEncoderFactory.create(encoder));
+    }
+
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibrary.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibrary.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibrary.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibrary.java Mon Feb 25 10:30:27 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -21,13 +21,21 @@
 public interface MusicLibrary
 {
     /**
+     * Gets a track by its unique id.
+     *
+     * @param id of track to retrieve
+     * @return the Track
+     * @throws IllegalArgumentException if no such track exists
+     */
+    Track getById(long id);
+
+    /**
      * Provides a list of all tracks in an indeterminate order.
      */
     List<Track> getTracks();
 
     /**
-     * Performs a case-insensitive search, finding all tracks whose title
-     * contains the input string (ignoring case).
+     * Performs a case-insensitive search, finding all tracks whose title contains the input string (ignoring case).
      *
      * @param title a partial title
      * @return a list of all matches

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibraryParser.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibraryParser.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibraryParser.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/services/MusicLibraryParser.java Mon Feb 25 10:30:27 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -33,8 +33,7 @@
 import java.util.List;
 
 /**
- * Reads an iTunes music library file into a list of
- * {@link org.apache.tapestry.integration.app1.data.Track} elements.
+ * Reads an iTunes music library file into a list of {@link org.apache.tapestry.integration.app1.data.Track} elements.
  */
 public class MusicLibraryParser
 {
@@ -293,6 +292,11 @@
             String value = peek().getContent();
 
             pop();
+
+            if (_key.equals("Track ID"))
+            {
+                _track.setId(Long.parseLong(value));
+            }
 
             if (_key.equals("Name"))
             {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderDispatcherTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderDispatcherTest.java?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderDispatcherTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderDispatcherTest.java Mon Feb 25 10:30:27 2008
@@ -106,7 +106,9 @@
         String path = "/foo/Bar" + (finalSlash ? "/" : "");
         train_getPath(request, path);
 
-        train_isPageName(resolver, "foo", false);
+        if (finalSlash)
+            train_isPageName(resolver, path.substring(1), false);
+
         train_isPageName(resolver, "foo/Bar", true);
 
         train_get(cache, "foo/Bar", page);
@@ -153,13 +155,19 @@
         String path = "/foo/Bar/zip/zoom" + (finalSlash ? "/" : "");
         train_getPath(request, path);
 
-        train_isPageName(resolver, "foo", false);
+        train_isPageName(resolver, path.substring(1), false);
+
+        if (finalSlash)
+            train_isPageName(resolver, "foo/Bar/zip/zoom", false);
+
+        train_isPageName(resolver, "foo/Bar/zip", false);
+
         train_isPageName(resolver, "foo/Bar", true);
 
         train_get(cache, "foo/Bar", page);
         train_getRootElement(page, rootElement);
 
-        train_triggerContextEvent(rootElement, TapestryConstants.ACTIVATE_EVENT, new Object[]{"zip", "zoom"}, false);
+        train_triggerContextEvent(rootElement, TapestryConstants.ACTIVATE_EVENT, new Object[] { "zip", "zoom" }, false);
 
         renderer.renderPageResponse(page);
 

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/module.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/module.apt?rev=630954&r1=630953&r2=630954&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/module.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/site/apt/module.apt Mon Feb 25 10:30:27 2008
@@ -156,7 +156,7 @@
   For modules, there are two additional parameter types that are used to refer to <resources> that
   can be provided to the module instance (rather than <services> which may be injected).    
       
-  * {{{http://www.slf4j.org/api/org/slf4j/Logger.html}org.slf5j.Logger}}: logger for the module (derived from the module's class name)
+  * {{{http://www.slf4j.org/api/org/slf4j/Logger.html}org.slf4j.Logger}}: logger for the module (derived from the module's class name)
    
   * {{{../apidocs/org/apache/tapestry/ioc/ObjectLocator.html}ObjectLocator}}:  access to other services