incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r900056 - in /incubator/aries/trunk/web/web-urlhandler: ./ src/main/java/org/apache/aries/web/converter/impl/ src/main/resources/OSGI-INF/blueprint/ src/test/java/org/apache/aries/web/converter/impl/
Date Sun, 17 Jan 2010 05:09:22 GMT
Author: gawor
Date: Sun Jan 17 05:09:21 2010
New Revision: 900056

URL: http://svn.apache.org/viewvc?rev=900056&view=rev
Log:
ARIES-119: Web-ContextPath must start with a slash. Also register the converter with the right
protocol name and remove a reference to old bundle activator

Modified:
    incubator/aries/trunk/web/web-urlhandler/pom.xml
    incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java
    incubator/aries/trunk/web/web-urlhandler/src/main/resources/OSGI-INF/blueprint/WARHandler.xml
    incubator/aries/trunk/web/web-urlhandler/src/test/java/org/apache/aries/web/converter/impl/WabConverterTest.java

Modified: incubator/aries/trunk/web/web-urlhandler/pom.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/pom.xml?rev=900056&r1=900055&r2=900056&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/pom.xml (original)
+++ incubator/aries/trunk/web/web-urlhandler/pom.xml Sun Jan 17 05:09:21 2010
@@ -59,7 +59,6 @@
                 <configuration>
                     <instructions>
                         <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
-                        <Bundle-Activator>org.apache.aries.application.converters.Activator</Bundle-Activator>
                         <Export-Package>
                             org.apache.aries.web.converter;version="${pom.version}",
                         </Export-Package>

Modified: incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java?rev=900056&r1=900055&r2=900056&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java
(original)
+++ incubator/aries/trunk/web/web-urlhandler/src/main/java/org/apache/aries/web/converter/impl/WarToWabConverterImpl.java
Sun Jan 17 05:09:21 2010
@@ -342,16 +342,17 @@
     //
 
     String webCPath = manifest.getMainAttributes().getValue(WEB_CONTEXT_PATH);
-    if (webCPath != null)
-    {
-      if (!webCPath.startsWith(DEFAULT_WEB_CONTEXT_PATH))
-      {
-          webCPath = DEFAULT_WEB_CONTEXT_PATH + webCPath;
-          properties.put(WEB_CONTEXT_PATH, webCPath);
-      }
+    if (webCPath == null) {
+        webCPath = properties.getProperty(WEB_CONTEXT_PATH);
     }
-    else if ( !properties.containsKey(WEB_CONTEXT_PATH)) {
-      properties.put(WEB_CONTEXT_PATH, DEFAULT_WEB_CONTEXT_PATH);
+    if (webCPath == null) {
+        properties.put(WEB_CONTEXT_PATH, DEFAULT_WEB_CONTEXT_PATH);
+    } else {
+        // always ensure context path starts with slash
+        if (!webCPath.startsWith("/")) {
+            webCPath = "/" + webCPath;
+        }
+        properties.put(WEB_CONTEXT_PATH, webCPath);
     }
 
     //

Modified: incubator/aries/trunk/web/web-urlhandler/src/main/resources/OSGI-INF/blueprint/WARHandler.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/src/main/resources/OSGI-INF/blueprint/WARHandler.xml?rev=900056&r1=900055&r2=900056&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/src/main/resources/OSGI-INF/blueprint/WARHandler.xml
(original)
+++ incubator/aries/trunk/web/web-urlhandler/src/main/resources/OSGI-INF/blueprint/WARHandler.xml
Sun Jan 17 05:09:21 2010
@@ -25,7 +25,7 @@
     <service-properties>
       <entry key="url.handler.protocol">
         <array value-type="java.lang.String">
-          <value>war</value>
+          <value>webbundle</value>
         </array>
       </entry>
     </service-properties>

Modified: incubator/aries/trunk/web/web-urlhandler/src/test/java/org/apache/aries/web/converter/impl/WabConverterTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/web/web-urlhandler/src/test/java/org/apache/aries/web/converter/impl/WabConverterTest.java?rev=900056&r1=900055&r2=900056&view=diff
==============================================================================
--- incubator/aries/trunk/web/web-urlhandler/src/test/java/org/apache/aries/web/converter/impl/WabConverterTest.java
(original)
+++ incubator/aries/trunk/web/web-urlhandler/src/test/java/org/apache/aries/web/converter/impl/WabConverterTest.java
Sun Jan 17 05:09:21 2010
@@ -118,12 +118,12 @@
   @Test
   public void testPropertySupport() throws Exception {
     Attributes attrs = convertWithProperties(
-        WarToWabConverterImpl.WEB_CONTEXT_PATH, "../WebFiles",
+        WarToWabConverterImpl.WEB_CONTEXT_PATH, "WebFiles",
         WarToWabConverterImpl.WEB_JSP_EXTRACT_LOCATION, "/jsp",
         Constants.BUNDLE_VERSION, "2.0",
         Constants.IMPORT_PACKAGE, "org.apache.aries.test;version=2.5,org.apache.aries.test.eba;version=1.0");
     
-    assertEquals("../WebFiles", attrs.getValue(WarToWabConverterImpl.WEB_CONTEXT_PATH));
+    assertEquals("/WebFiles", attrs.getValue(WarToWabConverterImpl.WEB_CONTEXT_PATH));
     assertEquals("/jsp", attrs.getValue(WarToWabConverterImpl.WEB_JSP_EXTRACT_LOCATION));
     assertEquals("2.0", attrs.getValue(Constants.BUNDLE_VERSION));
     assertEquals("org.apache.aries.test;version=2.5,org.apache.aries.test.eba;version=1.0,"+



Mime
View raw message