Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane

Author: mrdon
Date: Sat Oct 27 05:05:20 2007
New Revision: 589083

URL: http://svn.apache.org/viewvc?rev=589083&view=rev
Log:
Renamed default extension variable to be more clear

Modified:
   
struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java
   
struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml
   
struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java

Modified:
struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java?rev=589083&r1=589082&r2=589083&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java
(original)
+++
struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java
Sat Oct 27 05:05:20 2007
@@ -44,12 +44,12 @@
 public class ContentTypeHandlerManager {
 
     Map handlers = new
HashMap();
-    String defaultHandlerName;
+    String defaultExtension;
     public static final String STRUTS_REST_HANDLER_OVERRIDE_PREFIX =
"struts.rest.handlerOverride.";
 
-    @Inject("struts.rest.defaultHandlerName")
-    public void setDefaultHandlerName(String name) {
-        this.defaultHandlerName = name;
+    @Inject("struts.rest.defaultExtension")
+    public void setDefaultExtension(String name) {
+        this.defaultExtension = name;
     }
 
     @Inject
@@ -80,7 +80,7 @@
     public ContentTypeHandler getHandlerForRequest(HttpServletRequest req)
{
         String extension = findExtension(req.getRequestURI());
         if (extension == null) {
-            extension = defaultHandlerName;
+            extension = defaultExtension;
         }
         return handlers.get(extension);
     }

Modified:
struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml?rev=589083&r1=589082&r2=589083&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml
(original)
+++
struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml
Sat Oct 27 05:05:20 2007
@@ -18,7 +18,7 @@
     
 
     
-    
+    
     
     
     

Modified:
struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java?rev=589083&r1=589082&r2=589083&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java
(original)
+++
struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/ContentTypeHandlerManagerTest.java
Sat Oct 27 05:05:20 2007
@@ -78,7 +78,7 @@
             public String getExtension() { return "foo"; }
         };
         mgr.handlers.put("xml", handler);
-        mgr.defaultHandlerName = "xml";
+        mgr.defaultExtension = "xml";
         mgr.handleResult(new ActionConfig(), new
DefaultHttpHeaders().withStatus(SC_OK), obj);
 
         assertEquals(obj.getBytes().length,
mockResponse.getContentLength());
 
CD: 79ms