Examples of encodeResourceURL()


Examples of javax.faces.context.ExternalContext.encodeResourceURL()

            if (imageLocation != null) {
                buf.append(externalContext.encodeResourceURL(addResource.getResourceUri(context,
                                                                                        imageLocation + "/" + themeName)));
            }
            else {
                buf.append(externalContext.encodeResourceURL(addResource.getResourceUri(context,
                                                                                        HtmlJSCookMenuRenderer.class, themeLocation)));
            }
            buf.append("';");
            addResource.addInlineScriptAtPosition(context, AddResource.HEADER_BEGIN, buf.toString());
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        }

        String value = context.getApplication().getViewHandler().getResourceURL(context, IMAGE_DIRECT_LINK + image.getId());

        ExternalContext externalContext = context.getExternalContext();
        String relativeURL = externalContext.encodeResourceURL(value);
        Object request = externalContext.getRequest();

        if (request instanceof HttpServletRequest) {
            directLink = createServerURL((HttpServletRequest) request) + relativeURL;
        }
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        if (value.length() == 0 || value.charAt(0) != '/' || !value.startsWith(externalContext.getRequestContextPath())) {
            value = application.getViewHandler().getResourceURL(context, value);
        }

        return externalContext.encodeResourceURL(value);
    }

    public static Object getFirstNonEmptyAttribute(String attributeName, UIComponent component) {
        Object attributeValue = component.getAttributes().get(attributeName);
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        if (image != null)
        {
            // type="image"
            writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_IMAGE, JSFAttr.TYPE_ATTR);
            String src = facesContext.getApplication().getViewHandler().getResourceURL(facesContext, image);
            writer.writeURIAttribute(HTML.SRC_ATTR, externalContext.encodeResourceURL(src), JSFAttr.IMAGE_ATTR);
        }
        else
        {
            // type="button"
            writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_BUTTON, JSFAttr.TYPE_ATTR);
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

    final String partialAction;
    final boolean portlet = PortletUtils.isPortletApiAvailable() && response instanceof MimeResponse;
    if (portlet) {
      final MimeResponse mimeResponse = (MimeResponse) response;
      final ResourceURL resourceURL = mimeResponse.createResourceURL();
      partialAction = externalContext.encodeResourceURL(resourceURL.toString());
    } else {
      partialAction = null;
    }

    final String contentType = writer.getContentTypeWithCharSet();
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        if (image != null)
        {
            // type="image"
            writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_IMAGE, JSFAttr.TYPE_ATTR);
            String src = facesContext.getApplication().getViewHandler().getResourceURL(facesContext, image);
            writer.writeURIAttribute(HTML.SRC_ATTR, externalContext.encodeResourceURL(src), JSFAttr.IMAGE_ATTR);
        }
        else
        {
            // type="button"
            writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_BUTTON, JSFAttr.TYPE_ATTR);
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        url = viewHandler.getActionURL(facesContext, link);
        url = externalContext.encodeActionURL(url);
      } else if (link.contains(":")) { // external link
        url = link;
      } else { // internal relative link
        url = externalContext.encodeResourceURL(link);
      }

      StringBuilder builder = new StringBuilder(url);
      boolean firstParameter = !url.contains("?");
      for (UIComponent child : (List<UIComponent>) component.getChildren()) {
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        if (jsfResource) {
          url = viewHandler.getActionURL(facesContext, url);
          url = externalContext.encodeActionURL(url);
        } else {
          url = viewHandler.getResourceURL(facesContext, url);
          url = externalContext.encodeResourceURL(url);
        }
      } else {
        url = "";
      }
    } else if (component.getLink() != null) {
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

    if (!BooleanUtils.toBoolean(loggedIn)) {
      try {
        externalContext.getSessionMap().put(LOGGED_IN, Boolean.TRUE);
        String forward = externalContext.getRequestContextPath() + "/faces/addressbook/start.xhtml";
        externalContext.redirect(externalContext.encodeResourceURL(forward));
      } catch (Exception e) {
        LOG.error("", e);
        String forward = externalContext.getRequestContextPath() + "/error.xhtml";
        try {
          externalContext.redirect(externalContext.encodeResourceURL(forward));
View Full Code Here

Examples of javax.faces.context.ExternalContext.encodeResourceURL()

        externalContext.redirect(externalContext.encodeResourceURL(forward));
      } catch (Exception e) {
        LOG.error("", e);
        String forward = externalContext.getRequestContextPath() + "/error.xhtml";
        try {
          externalContext.redirect(externalContext.encodeResourceURL(forward));
        } catch (IOException e2) {
          LOG.error("", e2);
          throw new FacesException("Can't redirect to errorpage '" + forward + "'");
        }
      }
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.