Package org.apache.tapestry5.urlrewriter

Examples of org.apache.tapestry5.urlrewriter.SimpleRequestWrapper


        public Request process(Request request)
        {
            final String serverName = request.getServerName().replace("JSF", "tapestry");
            final String path = request.getPath().replace(".JSF", "");
            Request wrapper = new SimpleRequestWrapper(request, serverName, path);
            delegetingRequest.setRequest(wrapper);
            return delegetingRequest;
        }
View Full Code Here


  public Request process(Request request) {
   
    String path = request.getPath();
   
    if (path.startsWith(Constants.SHORTENED)) {
      request = new SimpleRequestWrapper(request, path.replaceFirst(Constants.SHORTENED, Constants.ORIGINAL));
    }
   
    return request;
   
  }
View Full Code Here

        return delegate.decodePageRenderRequest(request);
    }

    private Link rewriteIfNeeded(Link link, URLRewriteContext context)
    {
        SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, link.getBasePath());

        Request rewritten = urlRewriter.processLink(fakeRequest, context);

        // if the original request is equal to the rewritten one, no
        // rewriting is needed
View Full Code Here

        {
            public Request process(Request request,URLRewriteContext context)
            {
                final String serverName = request.getServerName().toUpperCase();
                final String path = request.getPath().toUpperCase();
                return new SimpleRequestWrapper(request, serverName, path);
            }

            public RewriteRuleApplicability applicability() {
                return RewriteRuleApplicability.BOTH;
            }
View Full Code Here

        public Request process(Request request, URLRewriteContext context)
        {
            final String serverName = request.getServerName().replace("JSF", "tapestry");
            final String path = request.getPath().replace(".JSF", "");
            Request wrapper = new SimpleRequestWrapper(request, serverName, path);
            delegetingRequest.setRequest(wrapper);
            return delegetingRequest;
        }
View Full Code Here

            public Request process(Request request)
            {
                final String path = request.getPath();
                if (path.equals("/struts"))
                {
                    request = new SimpleRequestWrapper(request, "/jsf");
                }
                return request;
               
            }
           
        };
       
        URLRewriterRule rule2 = new URLRewriterRule() {

            public Request process(Request request)
            {
                final String path = request.getPath();
                if (path.equals("/jsf"))
                {
                    request = new SimpleRequestWrapper(request, "/tapestry");
                }
                return request;
               
            }
           
        };
       
        URLRewriterRule rule3 = new URLRewriterRule() {

            public Request process(Request request)
            {
                String path = request.getPath();
                if (path.equals("/tapestry"))
                {
                    path = "/" + SUCCESS_PAGE_NAME;
                    request = new SimpleRequestWrapper(request, path);
                }
                return request;
               
            }
           
        };
       
        URLRewriterRule rule4 = new URLRewriterRule() {

            public Request process(Request request)
            {
                String serverName = request.getServerName();
                String path = request.getPath();
                if (serverName.equals(IntegrationTests.SUBDOMAIN) && path.equals("/"))
                {
                    path = String.format("/%s/%s", SUCCESS_PAGE_NAME, IntegrationTests.LOGIN);
                    request = new SimpleRequestWrapper(request, path);
                }
                return request;
               
            }
           
        };
       
        URLRewriterRule rule5 = new URLRewriterRule() {

            public Request process(Request request)
            {
                String serverName = request.getServerName();
                String path = request.getPath();
                final String pathToRewrite = "/" + SUCCESS_PAGE_NAME + "/login";
                if (serverName.equals("localhost") && path.equalsIgnoreCase(pathToRewrite))
                {
                    request = new SimpleRequestWrapper(request, IntegrationTests.SUBDOMAIN, "/");
                }
                return request;
               
            }
           
        };
       
        URLRewriterRule rule6 = new URLRewriterRule() {

            public Request process(Request request)
            {
                String serverName = request.getServerName();
                String path = request.getPath().toLowerCase();
                if (serverName.equals("localhost") && path.equals("/dummy"))
                {
                    request = new SimpleRequestWrapper(request, "/notdummy");
                }
                return request;
               
            }
           
View Full Code Here

     *            a {@link Link}.
     */
    Link rewriteIfNeeded(Link link)
    {
        Link newLink = null;
        SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, link.toAbsoluteURI());

        Request rewritten = urlRewriterService.process(fakeRequest);

        // if the original request is equal to the rewritten one, no
        // rewriting is needed
View Full Code Here

        {
            public Request process(Request request)
            {
                final String serverName = request.getServerName().toUpperCase();
                final String path = request.getPath().toUpperCase();
                return new SimpleRequestWrapper(request, serverName, path);
            }
        };

        InternalURLRewriterRule rule2 = new InternalURLRewriterRule();
View Full Code Here

        public Request process(Request request)
        {
            final String serverName = request.getServerName().replace("JSF", "tapestry");
            final String path = request.getPath().replace(".JSF", "");
            Request wrapper = new SimpleRequestWrapper(request, serverName, path);
            delegetingRequest.setRequest(wrapper);
            return delegetingRequest;
        }
View Full Code Here

     *            a {@link Link}.
     */
    Link rewriteIfNeeded(Link link, URLRewriteContext context)
    {
        Link newLink = null;
        SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, link.toAbsoluteURI());

        Request rewritten = urlRewriter.processLink(fakeRequest,context);

        // if the original request is equal to the rewritten one, no
        // rewriting is needed
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.urlrewriter.SimpleRequestWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.