1 Reply Latest reply on Jul 5, 2012 8:02 AM by joel_triemstra

    Combining URL shortening with error handling

    joel_triemstra Level 1

      We've implemented URL shortening using the etc/map node, and error handling using the /apps/sling/servlet/default/errorhandler/404.jsp. The 404.jsp contains a line that looks like

       

      request.getRequestDispatcher("/content/NorthAmerica/client/en_US/pages/home/404.html").for ward(request,response);

       

      The relevant entry in etc/map has a sling:Match of en_US/ and a sling:internalRedirect of /content/NorthAmerica/client/en_US/pages/home/

       

      This correctly shortens the links on pages in the site, and if I browse to www.client.com/en_US/asdf.html, I correctly get the error page rendered, but all the links on it have lost the URL shortening behavior.

       

      If I change the error handling JSP to

       

      request.getRequestDispatcher("en_US/404.html").forward(request,response); or request.getRequestDispatcher("/en_US/404.html").forward(request,response);

       

      then I get a blank page instead of the error page when I browse to asdf.html

       

      Is there a way to get these to work together? Also, I don't really have a good grasp of how the etc/map nodes fit into the process of locating a resource, rendering it, and issuing the response. Is there documentation around that?

       

      Thanks