Examples of URLRewriterRule


Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

        configuration.add(SymbolConstants.GZIP_COMPRESSION_ENABLED, "false");
    }
   
    public static void contributeURLRewriterRequestFilter(OrderedConfiguration<URLRewriterRule> configuration) {
       
        URLRewriterRule rule1 = new URLRewriterRule() {

            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"))
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void test_rewriter_rule_chaining() throws IOException
    {

        URLRewriterRule rule1 = new URLRewriterRule()
        {
            public Request process(Request request)
            {
                final String serverName = request.getServerName().toUpperCase();
                final String path = request.getPath().toUpperCase();
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void rewriter_rule_returns_null() throws IOException
    {

        URLRewriterRule rule = new URLRewriterRule()
        {
            public Request process(Request request)
            {
                return null;
            }
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void test_rewriter_rule_chaining() throws IOException
    {

        URLRewriterRule rule1 = new URLRewriterRule()
        {
            public Request process(Request request,URLRewriteContext context)
            {
                final String serverName = request.getServerName().toUpperCase();
                final String path = request.getPath().toUpperCase();
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void rewriter_rule_returns_null() throws IOException
    {

        URLRewriterRule rule = new URLRewriterRule()
        {
            public Request process(Request request,URLRewriteContext context)
            {
                return null;
            }
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

{
    private static final String SUCCESS_PAGE_NAME = URLRewriteSuccess.class.getSimpleName().toLowerCase();

    public static void contributeURLRewriterService(OrderedConfiguration<URLRewriterRule> configuration) {
       
        URLRewriterRule rule1 = new URLRewriterRule() {

            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();
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void test_rewriter_rule_chaining() throws IOException
    {

        URLRewriterRule rule1 = new URLRewriterRule()
        {
            public Request process(Request request)
            {
                final String serverName = request.getServerName().toUpperCase();
                final String path = request.getPath().toUpperCase();
View Full Code Here

Examples of org.apache.tapestry5.urlrewriter.URLRewriterRule

    @Test
    public void rewriter_rule_returns_null() throws IOException
    {

        URLRewriterRule rule = new URLRewriterRule()
        {
            public Request process(Request request)
            {
                return null;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.