Repository: incubator-juneau
Updated Branches:
  refs/heads/master c91d7b405 -> 7bf5e39a5


Remove unused methods.

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/7bf5e39a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/7bf5e39a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/7bf5e39a

Branch: refs/heads/master
Commit: 7bf5e39a59aab07bcf13cd02cbe65812a75c0853
Parents: c91d7b4
Author: JamesBognar <[email protected]>
Authored: Sat Jun 10 19:43:40 2017 -0400
Committer: JamesBognar <[email protected]>
Committed: Sat Jun 10 19:43:40 2017 -0400

----------------------------------------------------------------------
 .../examples/rest/UrlEncodedFormResource.java   |  2 +-
 .../microservice/resources/ConfigResource.java  |  2 +-
 .../apache/juneau/rest/test/PathsResource.java  |  2 +-
 .../apache/juneau/rest/test/UrisResource.java   |  2 +-
 .../org/apache/juneau/rest/test/UrisTest.java   | 55 ++++++++++----------
 .../java/org/apache/juneau/rest/CallMethod.java |  2 +-
 .../org/apache/juneau/rest/RestContext.java     |  2 +-
 .../org/apache/juneau/rest/RestRequest.java     | 26 +--------
 .../org/apache/juneau/rest/vars/RequestVar.java |  4 +-
 9 files changed, 36 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UrlEncodedFormResource.java
----------------------------------------------------------------------
diff --git 
a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UrlEncodedFormResource.java
 
b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UrlEncodedFormResource.java
index 95b2198..4a1425e 100644
--- 
a/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UrlEncodedFormResource.java
+++ 
b/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/UrlEncodedFormResource.java
@@ -56,7 +56,7 @@ public class UrlEncodedFormResource extends Resource {
                                +"\n            
document.getElementById('results').innerHTML = buffBody.innerHTML;"
                                +"\n    }"
                        ),
-                       
form().id("form").action(req.getServletURI()).method("POST").target("buff").children(
+                       
form().id("form").action("servlet:/").method("POST").target("buff").children(
                                table(
                                        tr(
                                                th(req.getMessage("aString")),

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java
----------------------------------------------------------------------
diff --git 
a/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java
 
b/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java
index b8d542a..fd3130e 100755
--- 
a/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java
+++ 
b/juneau-microservice/src/main/java/org/apache/juneau/microservice/resources/ConfigResource.java
@@ -60,7 +60,7 @@ public class ConfigResource extends Resource {
         */
        @RestMethod(name="GET", path="/edit", description="Edit config file.")
        public Form getConfigEditForm(RestRequest req) throws Exception {
-               return 
form().id("form").action(req.getServletURI()).method("POST").enctype("application/x-www-form-urlencoded").children(
+               return 
form().id("form").action("servlet:/").method("POST").enctype("application/x-www-form-urlencoded").children(
                        div()._class("data").children(
                                table(
                                        
tr(td().style("text-align:right").children(button("submit","Submit"),button("reset","Reset"))),

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/PathsResource.java
----------------------------------------------------------------------
diff --git 
a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/PathsResource.java 
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/PathsResource.java
index ea29610..23c24d6 100644
--- 
a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/PathsResource.java
+++ 
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/PathsResource.java
@@ -63,7 +63,7 @@ public class PathsResource extends RestServletDefault {
                        .append("requestParentURI", 
req.getUriContext().getRootRelativePathInfoParent())
                        .append("requestURL", req.getRequestURL())
                        .append("servletPath", req.getServletPath())
-                       .append("servletURI", req.getServletURI())
+                       .append("servletURI", 
req.getUriContext().getRootRelativeServletPath())
                        .append("servletParentURI", 
req.getUriContext().getRootRelativeServletPathParent())
                        .append("relativeServletURI", 
req.getRelativeServletURI());
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/UrisResource.java
----------------------------------------------------------------------
diff --git 
a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/UrisResource.java 
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/UrisResource.java
index 89d5172..bd64b36 100644
--- 
a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/UrisResource.java
+++ 
b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/UrisResource.java
@@ -112,7 +112,7 @@ public class UrisResource extends RestServletDefault {
                m.put("requestURI", req.getRequestURI());
                m.put("requestURL", req.getRequestURL());
                m.put("servletPath", req.getServletPath());
-               m.put("servletURI", req.getServletURI());
+               m.put("servletURI", 
req.getUriContext().getRootRelativeServletPath());
                return m;
        }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/UrisTest.java
----------------------------------------------------------------------
diff --git 
a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/UrisTest.java 
b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/UrisTest.java
index 2460dd4..48f3ba6 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/UrisTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/UrisTest.java
@@ -23,7 +23,6 @@ import org.junit.*;
  */
 public class UrisTest extends RestTestcase {
 
-       private static String URL2 = TestMicroservice.getURI() + "/testuris";   
        // /jazz/juneau/sample/testuris
        private static int port = TestMicroservice.getURI().getPort();          
        // 9443
        private static String path = TestMicroservice.getURI().getPath();       
       // /jazz/juneau/sample
 
@@ -46,7 +45,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/foo
@@ -60,7 +59,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/foo"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/foo/bar
@@ -74,7 +73,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test2
@@ -88,7 +87,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test2"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test2/foo
@@ -102,7 +101,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test2/foo"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test2/foo/bar
@@ -116,7 +115,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test2/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test4/test4
@@ -130,7 +129,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test4/test4"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test4/test4/foo
@@ -144,7 +143,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test4/test4/foo"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/test4/test4/foo/bar
@@ -158,7 +157,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/test4/test4/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris", r.getString("contextPath") + 
r.getString("servletPath"));  // App may not have context path, but combination 
should always equal path.
-               assertEquals(URL2, r.getString("servletURI"));
+               assertEquals(path + "/testuris", r.getString("servletURI"));
        }
 
        
//====================================================================================================
@@ -181,7 +180,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/foo
@@ -195,7 +194,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/foo/bar
@@ -209,7 +208,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2
@@ -223,7 +222,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test2"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2/foo
@@ -237,7 +236,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test2/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2/foo/bar
@@ -251,7 +250,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test2/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test4/test4
@@ -265,7 +264,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test4/test4"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test4/test4/foo
@@ -279,7 +278,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test4/test4/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // 
http://localhost:8080/sample/testuris/child/test4/test4/foo/bar
@@ -293,7 +292,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/test4/test4/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child", r.getString("servletURI"));
+               assertEquals(path + "/testuris/child", 
r.getString("servletURI"));
        }
 
        
//====================================================================================================
@@ -316,7 +315,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/foo
@@ -330,7 +329,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/foo/bar
@@ -344,7 +343,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2
@@ -358,7 +357,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test2"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2/foo
@@ -372,7 +371,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test2/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test2/foo/bar
@@ -386,7 +385,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test2/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test4/test4
@@ -400,7 +399,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test4/test4"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // http://localhost:8080/sample/testuris/child/test4/test4/foo
@@ -414,7 +413,7 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test4/test4/foo"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
 
                
//--------------------------------------------------------------------------------
                // 
http://localhost:8080/sample/testuris/child/test4/test4/foo/bar
@@ -428,6 +427,6 @@ public class UrisTest extends RestTestcase {
                assertTrue(r.getString("requestURL").endsWith(port + path + 
"/testuris/child/grandchild/test4/test4/foo/bar"));
                // Same for servlet
                assertEquals(path + "/testuris/child/grandchild", 
r.getString("contextPath") + r.getString("servletPath"));  // App may not have 
context path, but combination should always equal path.
-               assertEquals(URL2 + "/child/grandchild", 
r.getString("servletURI"));
+               assertEquals(path + "/testuris/child/grandchild", 
r.getString("servletURI"));
        }
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest/src/main/java/org/apache/juneau/rest/CallMethod.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/CallMethod.java 
b/juneau-rest/src/main/java/org/apache/juneau/rest/CallMethod.java
index f6753e5..7ba5e8c 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/CallMethod.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/CallMethod.java
@@ -843,7 +843,7 @@ class CallMethod implements Comparable<CallMethod>  {
                                        if (k.equals(REST_servletPath))
                                                return req.getServletPath();
                                        if (k.equals(REST_servletURI))
-                                               return req.getServletURI();
+                                               return 
req.getUriContext().getRootRelativeServletPath();
                                        if (k.equals(REST_relativeServletURI))
                                                return 
req.getRelativeServletURI();
                                        if (k.equals(REST_pathInfo))

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java 
b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java
index f14a271..e5aa62e 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -215,7 +215,7 @@ public final class RestContext extends Context {
        /**
         * The request servlet URI.
         * <p>
-        * Equivalent to the value returned by {@link 
RestRequest#getServletURI()}
+        * Equivalent to the value returned by {@link 
UriContext#getRootRelativeServletPath()}
         */
        public static final String REST_servletURI = "RestServlet.servletURI";
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java 
b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
index c921a55..3234249 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestRequest.java
@@ -82,7 +82,7 @@ public final class RestRequest extends 
HttpServletRequestWrapper {
        private RequestPathMatch pathParams;
        private boolean isPost;
        private UriContext uriContext;
-       private String servletURI, relativeServletURI;
+       private String relativeServletURI;
        private String charset, defaultCharset;
        private RequestHeaders headers;
        private ConfigFile cf;
@@ -509,21 +509,6 @@ public final class RestRequest extends 
HttpServletRequestWrapper {
        }
 
        /**
-        * Gets the URI of the servlet (e.g. 
<js>"https://localhost:9080/contextPath/servletPath";</js>).
-        *
-        * @return The servlet URI.
-        */
-       public String getServletURI() {
-               if (servletURI == null) {
-                       // Note that we can't use getPathInfo() to calculate 
this since it replaces
-                       // URL-encoded chars (e.g. %2F) which throws off the 
length calculation
-                       // because getRequestURL() does not replace those chars.
-                       servletURI = getServletURIBuilder().toString();
-               }
-               return servletURI;
-       }
-
-       /**
         * Gets the path-absolute relative URI of the servlet (e.g. 
<js>"/contextPath/servletPath"</js>).
         *
         * @return The relative servlet URI.
@@ -534,15 +519,6 @@ public final class RestRequest extends 
HttpServletRequestWrapper {
                return relativeServletURI;
        }
 
-       /**
-        * Returns a <code>StringBuffer</code> prefilled with the string 
<code><js>"/[contextPath]/[servletPath]"</js></code>.
-        *
-        * @return The servlet URI string builder.
-        */
-       public StringBuffer getServletURIBuilder() {
-               return RestUtils.trimPathInfo(getRequestURL(), 
getContextPath(), getServletPath());
-       }
-
 
        
//--------------------------------------------------------------------------------
        // Labels

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/7bf5e39a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
----------------------------------------------------------------------
diff --git 
a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java 
b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
index c23e2c0..7fecd38 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/vars/RequestVar.java
@@ -33,7 +33,7 @@ import org.apache.juneau.svl.*;
  *     <li><code>$R{servletTitle}</code> - Value returned by {@link 
RestRequest#getServletTitle()}.
  *     <li><code>$R{servletParentURI}</code> - Value returned by {@link 
UriContext#getRootRelativeServletPathParent()}.
  *     <li><code>$R{servletPath}</code> - Value returned by {@link 
RestRequest#getServletPath()}.
- *     <li><code>$R{servletURI}</code> - Value returned by {@link 
RestRequest#getServletURI()}.
+ *     <li><code>$R{servletURI}</code> - Value returned by {@link 
UriContext#getRootRelativeServletPath()}.
  *     <li><code>$R{trimmedRequestURI}</code> - Value returned by {@link 
RestRequest#getTrimmedRequestURI()}.
  * </ul>
  * <p>
@@ -106,7 +106,7 @@ public class RequestVar extends SimpleVar {
                                        if (key.equals("servletPath"))
                                                return req.getServletPath();
                                        if (key.equals("servletURI"))
-                                               return req.getServletURI();
+                                               return 
req.getUriContext().getRootRelativeServletPath();
                                        if (key.equals("servletParentURI"))
                                                return 
req.getUriContext().getRootRelativeServletPathParent();
                                        if (key.equals("servletTitle"))

Reply via email to