You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2017/06/22 08:28:49 UTC

svn commit: r1799548 - in /myfaces/tobago/trunk/tobago-example/tobago-example-demo: pom.xml src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java

Author: lofwyr
Date: Thu Jun 22 08:28:49 2017
New Revision: 1799548

URL: http://svn.apache.org/viewvc?rev=1799548&view=rev
Log:
fix old demo links in case of a contextPath

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml?rev=1799548&r1=1799547&r2=1799548&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml Thu Jun 22 08:28:49 2017
@@ -115,6 +115,11 @@
               <value>target/derby.log</value>
             </systemProperty>
           </systemProperties>
+<!--
+          <webApp>
+            <contextPath>/example</contextPath>
+          </webApp>
+-->
         </configuration>
         <dependencies>
         </dependencies>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java?rev=1799548&r1=1799547&r2=1799548&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/OldLinksServlet.java Thu Jun 22 08:28:49 2017
@@ -42,7 +42,7 @@ public class OldLinksServlet extends Htt
     protected void doGet(HttpServletRequest request, HttpServletResponse response)
             throws ServletException, IOException {
         response.setStatus(HttpServletResponse.SC_FOUND);
-        response.sendRedirect(request.getRequestURI().substring("/faces".length()));
+        response.sendRedirect(request.getContextPath() + request.getPathInfo());
 
         LOG.warn("Old URI was called: {}", request.getRequestURI(), request.getHeader(HttpHeaders.REFERER));
     }