pivot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gbr...@apache.org
Subject svn commit: r951703 - in /pivot/trunk: demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java web-server/src/org/apache/pivot/web/server/QueryServlet.java
Date Sat, 05 Jun 2010 12:48:53 GMT
Author: gbrown
Date: Sat Jun  5 12:48:52 2010
New Revision: 951703

URL: http://svn.apache.org/viewvc?rev=951703&view=rev
Log:
Resolve issue PIVOT-516.

Modified:
    pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java
    pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java

Modified: pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java?rev=951703&r1=951702&r2=951703&view=diff
==============================================================================
--- pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java (original)
+++ pivot/trunk/demos-server/src/org/apache/pivot/demos/rest/server/RESTDemoServlet.java Sat
Jun  5 12:48:52 2010
@@ -83,8 +83,7 @@ public class RESTDemoServlet extends Que
         // Return the location of the resource
         URL location;
         try {
-            location = new URL(isSecure() ? HTTPS_PROTOCOL : HTTP_PROTOCOL, getHostname(),
getPort(),
-                getContextPath() + getServletPath() + "/" + file.getName());
+            location = new URL(getLocation(), file.getName());
         } catch (MalformedURLException exception) {
             throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
         }

Modified: pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java
URL: http://svn.apache.org/viewvc/pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java?rev=951703&r1=951702&r2=951703&view=diff
==============================================================================
--- pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java (original)
+++ pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java Sat Jun  5 12:48:52
2010
@@ -187,6 +187,21 @@ public abstract class QueryServlet exten
     }
 
     /**
+     * Returns the location of this servlet.
+     */
+    public URL getLocation() {
+        URL location;
+        try {
+            location = new URL(isSecure() ? HTTPS_PROTOCOL : HTTP_PROTOCOL, getHostname(),
getPort(),
+                getContextPath() + getServletPath() + "/");
+        } catch (MalformedURLException exception) {
+            throw new RuntimeException(exception);
+        }
+
+        return location;
+    }
+
+    /**
      * Returns the servlet's parameter dictionary, which holds the values
      * passed in the HTTP request query string.
      */



Mime
View raw message