Package net.sourceforge.stripes.util

Examples of net.sourceforge.stripes.util.UrlBuilder$Parameter


                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here


            throw new StripesJspException("The form tag attributes 'beanClass' and 'action' "
                    + "are both null. One of the two must be supplied to determine which "
                    + "action bean should handle the form submission.");
        }
        getTagStack().push(this);
        urlBuilder = new UrlBuilder(pageContext.getRequest().getLocale(), getAction(), false)
                .setEvent(null);
        return EVAL_BODY_BUFFERED;
    }
View Full Code Here


        // Add all the parameters and reset the href attribute; pass to false here because
        // the HtmlTagSupport will HtmlEncode the ampersands for us
        String base = getPreferredBaseUrl();
        UrlBuilder builder = new UrlBuilder(pageContext.getRequest().getLocale(), base, false);
        if (this.event != VALUE_NOT_SET) {
            builder.setEvent(this.event == null || this.event.length() < 1 ? null : this.event);
        }
        if (addSourcePage) {
            builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE,
                    CryptoUtil.encrypt(request.getServletPath()));
        }
        if (this.anchor != null) {
            builder.setAnchor(anchor);
        }
        builder.addParameters(this.parameters);

        // Prepend the context path, but only if the user didn't already
        String url = builder.toString();
        if (prependContext) {
            String contextPath = request.getContextPath();
            if (contextPath.length() > 1 && !url.startsWith(contextPath + '/'))
                url = contextPath + url;
        }
View Full Code Here

     * supplied.
     *
     * @param locale the locale to be used by {@link Formatter}s when formatting parameters
     */
    public String getUrl(Locale locale) {
        UrlBuilder builder = new UrlBuilder(locale, path, false);
        if (event != VALUE_NOT_SET) {
            builder.setEvent(event == null || event.length() < 1 ? null : event);
        }
        if (anchor != null) {
            builder.setAnchor(anchor);
        }
        builder.addParameters(this.parameters);
        return builder.toString();
    }
View Full Code Here

     * supplied.
     *
     * @param locale the locale to be used by {@link Formatter}s when formatting parameters
     */
    public String getUrl(Locale locale) {
        UrlBuilder builder = new UrlBuilder(locale, getPath(), false);
        if (event != VALUE_NOT_SET) {
            builder.setEvent(event == null || event.length() < 1 ? null : event);
        }
        if (anchor != null) {
            builder.setAnchor(anchor);
        }
        builder.addParameters(this.parameters);
        return builder.toString();
    }
View Full Code Here

            throw new StripesJspException("The form tag attributes 'beanClass' and 'action' "
                    + "are both null. One of the two must be supplied to determine which "
                    + "action bean should handle the form submission.");
        }
        getTagStack().push(this);
        urlBuilder = new UrlBuilder(pageContext.getRequest().getLocale(), getAction(), false)
                .setEvent(null);
        return EVAL_BODY_BUFFERED;
    }
View Full Code Here


        // Add all the parameters and reset the href attribute; pass to false here because
        // the HtmlTagSupport will HtmlEncode the ampersands for us
        String base = getPreferredBaseUrl();
        UrlBuilder builder = new UrlBuilder(pageContext.getRequest().getLocale(), base, false);
        if (this.event != VALUE_NOT_SET) {
            builder.setEvent(this.event == null || this.event.length() < 1 ? null : this.event);
        }
        if (addSourcePage) {
            builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE,
                    CryptoUtil.encrypt(request.getServletPath()));
        }
        if (this.anchor != null) {
            builder.setAnchor(anchor);
        }
        builder.addParameters(this.parameters);

        // Prepend the context path, but only if the user didn't already
        String url = builder.toString();
        String contextPath = request.getContextPath();
        if (contextPath.length() > 1) {
            boolean prepend = prependContext != null && prependContext
                    || prependContext == null && beanclass != null
                    || prependContext == null && url.startsWith("/") && !url.startsWith(contextPath);
View Full Code Here

            throw new StripesJspException("The form tag attributes 'beanClass' and 'action' "
                    + "are both null. One of the two must be supplied to determine which "
                    + "action bean should handle the form submission.");
        }
        getTagStack().push(this);
        urlBuilder = new UrlBuilder(pageContext.getRequest().getLocale(), getAction(), false)
                .setEvent(null);
        return EVAL_BODY_BUFFERED;
    }
View Full Code Here

     * supplied.
     *
     * @param locale the locale to be used by {@link Formatter}s when formatting parameters
     */
    public String getUrl(Locale locale) {
        UrlBuilder builder = new UrlBuilder(locale, getPath(), false);
        if (event != VALUE_NOT_SET) {
            builder.setEvent(event == null || event.length() < 1 ? null : event);
        }
        if (anchor != null) {
            builder.setAnchor(anchor);
        }
        builder.addParameters(this.parameters);
        return builder.toString();
    }
View Full Code Here

            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.util.UrlBuilder$Parameter

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.