Package org.apache.beehive.netui.core.urls

Examples of org.apache.beehive.netui.core.urls.MutableURI


                                    HttpServletResponse response, LinkedHashMap/*<String, List<String>>*/ extraHiddenParams)
            throws URISyntaxException
    {
        String qualifiedAction = InternalUtils.qualifyAction(servletContext, _state.action);
        String actionUrl = InternalUtils.createActionURL(request, qualifiedAction);
        MutableURI uri = new MutableURI(actionUrl, true);
        uri.setFragment(_location);
        uri.setEncoding(response.getCharacterEncoding());

        boolean needsToBeSecure = PageFlowUtils.needsToBeSecure(servletContext, request, actionUrl, true);
        URLRewriterService.rewriteURL(servletContext, request, response, uri, URLType.ACTION, needsToBeSecure);

        // Add a scope-ID hidden input, if there's one on this tag, or one in the request.
        String targetScope = (_targetScope != null) ? _targetScope : request.getParameter(ScopedServletUtils.SCOPE_ID_PARAM);
        if (targetScope != null) {
            if (_params == null) {
                _params = new HashMap();
            }
            _params.put(ScopedServletUtils.SCOPE_ID_PARAM, targetScope);
            // If there's one on the URL, we're replacing it with a hidden param.
            if (uri != null) {
                uri.removeParameter(ScopedServletUtils.SCOPE_ID_PARAM);
            }
        }

        // Check if the rewritten form action contains request parameters that need
        // to be turned into hidden fields -- shouldn't include them in the action
        // URI on a GET.
        boolean forXML = false;
        if (_state.method != null && _state.method.equalsIgnoreCase(FORM_GET)
                && !URLRewriterService.allowParamsOnFormAction(servletContext, request)) {
            extraHiddenParams.putAll(uri.getParameters());
        }
        else {
            // Params are allowed on the form action so see if this is for XHTML
            forXML = TagRenderingBase.Factory.isXHTML(request);
        }
View Full Code Here


    public static String getRewrittenActionURI( ServletContext servletContext, HttpServletRequest request,
                                                HttpServletResponse response, String actionName, Map params,
                                                String fragment, boolean forXML )
            throws URISyntaxException
    {
        MutableURI uri = getActionURI( servletContext, request, response, actionName );
        if ( params != null ) uri.addParameters( params, false );
        if ( fragment != null ) uri.setFragment( uri.encode( fragment ) );

        boolean needsToBeSecure = needsToBeSecure( servletContext, request, uri.getPath(), true );
        URLRewriterService.rewriteURL( servletContext, request, response, uri, URLType.ACTION, needsToBeSecure );
        String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
        URIContext uriContext = URIContextFactory.getInstance( forXML );

        return URLRewriterService.getTemplatedURL( servletContext, request, uri, key, uriContext );
View Full Code Here

                                    HttpServletResponse response, LinkedHashMap/*<String, List<String>>*/ extraHiddenParams)
            throws URISyntaxException
    {
        String qualifiedAction = InternalUtils.qualifyAction(servletContext, _state.action);
        String actionUrl = InternalUtils.createActionURL(request, qualifiedAction);
        MutableURI uri = new MutableURI(actionUrl, true);
        uri.setFragment(_location);
        uri.setEncoding(response.getCharacterEncoding());

        boolean needsToBeSecure = PageFlowUtils.needsToBeSecure(servletContext, request, actionUrl, true);
        URLRewriterService.rewriteURL(servletContext, request, response, uri, URLType.ACTION, needsToBeSecure);

        // Add a scope-ID hidden input, if there's one on this tag, or one in the request.
        String targetScope = (_targetScope != null) ? _targetScope : request.getParameter(ScopedServletUtils.SCOPE_ID_PARAM);
        if (targetScope != null) {
            if (_params == null) {
                _params = new HashMap();
            }
            _params.put(ScopedServletUtils.SCOPE_ID_PARAM, targetScope);
            // If there's one on the URL, we're replacing it with a hidden param.
            if (uri != null) {
                uri.removeParameter(ScopedServletUtils.SCOPE_ID_PARAM);
            }
        }

        // Check if the rewritten form action contains request parameters that need
        // to be turned into hidden fields -- shouldn't include them in the action
        // URI on a GET.
        boolean forXML = false;
        if (_state.method != null && _state.method.equalsIgnoreCase(FORM_GET)
                && !URLRewriterService.allowParamsOnFormAction(servletContext, request)) {
            extraHiddenParams.putAll(uri.getParameters());
        }
        else {
            // Params are allowed on the form action so see if this is for XHTML
            forXML = TagRenderingBase.Factory.isXHTML(request);
        }
View Full Code Here

    public static String getRewrittenActionURI( ServletContext servletContext, HttpServletRequest request,
                                                HttpServletResponse response, String actionName, Map params,
                                                String fragment, boolean forXML )
            throws URISyntaxException
    {
        MutableURI uri = getActionURI( servletContext, request, response, actionName );
        if ( params != null ) uri.addParameters( params, false );
        if ( fragment != null ) uri.setFragment( uri.encode( fragment ) );

        boolean needsToBeSecure = needsToBeSecure( servletContext, request, uri.getPath(), true );
        URLRewriterService.rewriteURL( servletContext, request, response, uri, URLType.ACTION, needsToBeSecure );
        String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
        URIContext uriContext = URIContextFactory.getInstance( forXML );

        return URLRewriterService.getTemplatedURL( request, uri, key, uriContext );
View Full Code Here

    {
        String actionName = _state.action;
        if (actionName.length() > 0 && actionName.charAt(0) == '/') {
            actionName = actionName.substring(1);
        }
        MutableURI uri = PageFlowUtils.getActionURI(servletContext, request, response, actionName);
        uri.setFragment(_location);
        uri.setEncoding(response.getCharacterEncoding());

        boolean needsToBeSecure = PageFlowUtils.needsToBeSecure(servletContext, request, uri.getPath(), true);
        URLRewriterService.rewriteURL(servletContext, request, response, uri, URLType.ACTION, needsToBeSecure);

        // Add a scope-ID hidden input, if there's one on this tag, or one in the request.
        String targetScope = (_targetScope != null) ? _targetScope : request.getParameter(ScopedServletUtils.SCOPE_ID_PARAM);
        if (targetScope != null) {
            if (_params == null) {
                _params = new HashMap();
            }
            _params.put(ScopedServletUtils.SCOPE_ID_PARAM, targetScope);
            // If there's one on the URL, we're replacing it with a hidden param.
            if (uri != null) {
                assert uri instanceof FreezableMutableURI : uri.getClass().getName();
                ((FreezableMutableURI) uri).setFrozen(false);
                uri.removeParameter(ScopedServletUtils.SCOPE_ID_PARAM);
            }
        }

        // Check if the rewritten form action contains request parameters that need
        // to be turned into hidden fields -- shouldn't include them in the action
        // URI on a GET.
        boolean forXML = false;
        if (_state.method != null && _state.method.equalsIgnoreCase(FORM_GET)
                && !URLRewriterService.allowParamsOnFormAction(servletContext, request)) {
            extraHiddenParams.putAll(uri.getParameters());
        }
        else {
            // Params are allowed on the form action so see if this is for XHTML
            forXML = TagRenderingBase.Factory.isXHTML(request);
        }
View Full Code Here

    public static String getRewrittenActionURI( ServletContext servletContext, HttpServletRequest request,
                                                HttpServletResponse response, String actionName, Map params,
                                                String fragment, boolean forXML )
            throws URISyntaxException
    {
        MutableURI uri = getActionURI( servletContext, request, response, actionName );
        if ( params != null ) uri.addParameters( params, false );
        if ( fragment != null ) uri.setFragment( uri.encode( fragment ) );

        boolean needsToBeSecure = needsToBeSecure( servletContext, request, uri.getPath(), true );
        URLRewriterService.rewriteURL( servletContext, request, response, uri, URLType.ACTION, needsToBeSecure );
        String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
        URIContext uriContext = URIContextFactory.getInstance( forXML );

        return URLRewriterService.getTemplatedURL( servletContext, request, uri, key, uriContext );
View Full Code Here

    {
        String actionName = _state.action;
        if (actionName.length() > 0 && actionName.charAt(0) == '/') {
            actionName = actionName.substring(1);
        }
        MutableURI uri = PageFlowUtils.getActionURI(servletContext, request, response, actionName);
        uri.setFragment(_location);
        uri.setEncoding(response.getCharacterEncoding());

        boolean needsToBeSecure = PageFlowUtils.needsToBeSecure(servletContext, request, uri.getPath(), true);
        URLRewriterService.rewriteURL(servletContext, request, response, uri, URLType.ACTION, needsToBeSecure);

        // Add a scope-ID hidden input, if there's one on this tag, or one in the request.
        String targetScope = (_targetScope != null) ? _targetScope : request.getParameter(ScopedServletUtils.SCOPE_ID_PARAM);
        if (targetScope != null) {
            if (_params == null) {
                _params = new HashMap();
            }
            _params.put(ScopedServletUtils.SCOPE_ID_PARAM, targetScope);
            // If there's one on the URL, we're replacing it with a hidden param.
            if (uri != null) {
                assert uri instanceof FreezableMutableURI : uri.getClass().getName();
                ((FreezableMutableURI) uri).setFrozen(false);
                uri.removeParameter(ScopedServletUtils.SCOPE_ID_PARAM);
            }
        }

        // Check if the rewritten form action contains request parameters that need
        // to be turned into hidden fields -- shouldn't include them in the action
        // URI on a GET.
        boolean forXML = false;
        if (_state.method != null && _state.method.equalsIgnoreCase(FORM_GET)
                && !URLRewriterService.allowParamsOnFormAction(servletContext, request)) {
            extraHiddenParams.putAll(uri.getParameters());
        }
        else {
            // Params are allowed on the form action so see if this is for XHTML
            forXML = TagRenderingBase.Factory.isXHTML(request);
        }
View Full Code Here

    public static String getRewrittenActionURI( ServletContext servletContext, HttpServletRequest request,
                                                HttpServletResponse response, String actionName, Map params,
                                                String fragment, boolean forXML )
            throws URISyntaxException
    {
        MutableURI uri = getActionURI( servletContext, request, response, actionName );
        if ( params != null ) uri.addParameters( params, false );
        if ( fragment != null ) uri.setFragment( uri.encode( fragment ) );

        boolean needsToBeSecure = needsToBeSecure( servletContext, request, uri.getPath(), true );
        URLRewriterService.rewriteURL( servletContext, request, response, uri, URLType.ACTION, needsToBeSecure );
        String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
        URIContext uriContext = URIContextFactory.getInstance( forXML );

        return URLRewriterService.getTemplatedURL( servletContext, request, uri, key, uriContext );
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.core.urls.MutableURI

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.