Package net.sourceforge.stripes.util

Examples of net.sourceforge.stripes.util.UrlBuilder


            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

TOP

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

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.