summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-08-29 08:47:38 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-08-29 08:47:38 +0000
commitee6e0aba9dfeaf594c01ea088a8e31efc6517d49 (patch)
treed7ccd48e06d248f09582ac1aa887e11e34e52a07 /sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache
parent7c168efe67b5423c0944290acb4b81fa6c50671e (diff)
Merging changes from svn r988356: Test for null or empty servlet path info before redirecting to same URL with trailing /.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@990507 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache')
-rw-r--r--sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
index 32abd5ded8..e0a681ed36 100644
--- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
+++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingListenerServlet.java
@@ -129,13 +129,14 @@ public class RESTBindingListenerServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Get the request path
- String path = URLDecoder.decode(request.getPathInfo(), "UTF-8");
- if (path.length() ==0) {
+ String pathInfo = request.getPathInfo();
+ if (pathInfo == null || pathInfo.length() == 0) {
// Redirect to a URL ending with / to make relative hrefs work
// relative to the served resource.
response.sendRedirect(request.getRequestURL().append('/').toString());
return;
}
+ String path = URLDecoder.decode(pathInfo, "UTF-8");
// Invoke the get operation on the service implementation
Message requestMessage = messageFactory.createMessage();