Package com.alibaba.citrus.webx.util

Examples of com.alibaba.citrus.webx.util.RequestURIFilter


    private void assertExcluded(boolean excluded, String requestURI) throws Exception {
        assertExcluded(excluded, requestURI, false);
    }

    private void assertExcluded(boolean excluded, String requestURI, boolean internal) throws Exception {
        RequestURIFilter excludes = getFieldValue(filter, "excludeFilter", RequestURIFilter.class);

        HttpServletRequest request = createMock(HttpServletRequest.class);
        HttpServletResponse response = createMock(HttpServletResponse.class);
        FilterChain filterChain = createMock(FilterChain.class);

        // 不会调用getContextPath和getRequestURI
        expect(request.getServletPath()).andReturn(requestURI).anyTimes();
        expect(request.getPathInfo()).andReturn(null).anyTimes();

        if (excluded && !internal) {
            filterChain.doFilter(request, response);
        }

        replay(request, response, filterChain);

        if (internal) {
            assertFalse(filter.isExcluded(getResourcePath(request)));
        } else {
            assertEquals(excluded, excludes.matches(requestURI));
        }

        if (excluded && !internal) {
            filter.doFilter(request, response, filterChain); // 对excluded request调用doFilter,应该立即返回
            assertTrue(filter.isExcluded(getResourcePath(request)));
View Full Code Here


        this.parentContextAttribute = trimToNull(parentContextAttribute);
    }

    /** 设置要排除掉的URL。 */
    public void setExcludes(String excludes) {
        excludeFilter = new RequestURIFilter(excludes);
    }
View Full Code Here

    /**
     * 设置不需要执行pipeline的URL。该功能可被用于将webx作为其它servlet的filter,这样,
     * 其它的servlet可以使用webx所提供的request context功能,例如:session等。
     */
    public void setPassthru(String passthru) {
        passthruFilter = new RequestURIFilter(passthru);
    }
View Full Code Here

        this.parentContextAttribute = trimToNull(parentContextAttribute);
    }

    /** 设置要排除掉的URL。 */
    public void setExcludes(String excludes) {
        excludeFilter = new RequestURIFilter(excludes);
    }
View Full Code Here

    /**
     * 设置不需要执行pipeline的URL。该功能可被用于将webx作为其它servlet的filter,这样,
     * 其它的servlet可以使用webx所提供的request context功能,例如:session等。
     */
    public void setPassthru(String passthru) {
        passthruFilter = new RequestURIFilter(passthru);
    }
View Full Code Here

    /**
     * ����Ҫ�ų�����URL��
     */
    public void setExcludes(String excludes) {
        excludeFilter = new RequestURIFilter(excludes);
    }
View Full Code Here

    /**
     * ���ò���Ҫִ��pipeline��URL���ù��ܿɱ����ڽ�webx��Ϊ����servlet��filter��������
     * ������servlet����ʹ��webx���ṩ��request context���ܣ����磺session�ȡ�
     */
    public void setPassthru(String passthru) {
        passthruFilter = new RequestURIFilter(passthru);
    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.webx.util.RequestURIFilter

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.