javax.faces.application.Resource.userAgentNeedsUpdate()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中javax.faces.application.Resource.userAgentNeedsUpdate方法的一些代码示例,展示了Resource.userAgentNeedsUpdate的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.userAgentNeedsUpdate方法的具体详情如下:
包路径:javax.faces.application.Resource
类名称:Resource
方法名:userAgentNeedsUpdate

Resource.userAgentNeedsUpdate介绍

[英]Return true if the user-agent requesting this resource needs an update. If the If-Modified-Since HTTP header is available for this request, its value must be consulted, as specified in Section 14.25 of IETF RFC 2616, to determine the result. Returns false if the user-agent does not need an update for this resource.
[中]如果请求此资源的用户代理需要更新,则返回true。如果If Modified Since HTTP头可用于该请求,则必须按照IETF RFC 2616第14.25节的规定,查阅其值,以确定结果。如果用户代理不需要更新此资源,则返回false

代码示例

代码示例来源:origin: org.icefaces/icefaces-ace

public boolean userAgentNeedsUpdate(FacesContext context) {
  return resource.userAgentNeedsUpdate(context);
}

代码示例来源:origin: omnifaces/omnifaces

@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  Resource wrapped = getWrapped();
  return (wrapped != null) ? wrapped.userAgentNeedsUpdate(context) : false;
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-impl

public boolean userAgentNeedsUpdate(FacesContext context)
{
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: javax/javaee-web-api

/**
 * <p class="changed_added_2_0">The default behavior of this method
 * is to call {@link Resource#userAgentNeedsUpdate} on the wrapped {@link
 * ResourceHandler} object.</p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.glassfish/jakarta.faces

/**
 * <p class="changed_added_2_0">
 * The default behavior of this method is to call {@link Resource#userAgentNeedsUpdate} on the
 * wrapped {@link ResourceHandler} object.
 * </p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-api

@Override
public boolean userAgentNeedsUpdate(FacesContext context)
{
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: eclipse-ee4j/mojarra

/**
 * <p class="changed_added_2_0">
 * The default behavior of this method is to call {@link Resource#userAgentNeedsUpdate} on the
 * wrapped {@link ResourceHandler} object.
 * </p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: eclipse-ee4j/mojarra

/**
 * <p class="changed_added_2_0">
 * The default behavior of this method is to call {@link Resource#userAgentNeedsUpdate} on the
 * wrapped {@link ResourceHandler} object.
 * </p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: com.sun.faces/jsf-api

/**
 * <p class="changed_added_2_0">The default behavior of this method
 * is to call {@link Resource#userAgentNeedsUpdate} on the wrapped {@link
 * ResourceHandler} object.</p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
  
}

代码示例来源:origin: javax.faces/javax.faces-api

/**
 * <p class="changed_added_2_0">The default behavior of this method
 * is to call {@link Resource#userAgentNeedsUpdate} on the wrapped {@link
 * ResourceHandler} object.</p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.glassfish/javax.faces

/**
 * <p class="changed_added_2_0">
 * The default behavior of this method is to call {@link Resource#userAgentNeedsUpdate} on the
 * wrapped {@link ResourceHandler} object.
 * </p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.apache.myfaces.core/myfaces-shaded-impl

public boolean userAgentNeedsUpdate(FacesContext context)
{
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.omnifaces/omnifaces

@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  Resource wrapped = getWrapped();
  return (wrapped != null) ? wrapped.userAgentNeedsUpdate(context) : false;
}

代码示例来源:origin: org.jboss.spec.javax.faces/jboss-jsf-api_2.0_spec

/**
 * <p class="changed_added_2_0">The default behavior of this method
 * is to call {@link Resource#userAgentNeedsUpdate} on the wrapped {@link
 * ResourceHandler} object.</p>
 */
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
  
}

代码示例来源:origin: liferay/liferay-faces

@Override
public boolean userAgentNeedsUpdate(FacesContext facesContext) {
  return getInternalResource().userAgentNeedsUpdate(facesContext);
}

代码示例来源:origin: jboss/jboss-javaee-specs

/**
 * <p class="changed_added_2_0">The default behavior of this method
 * is to call {@link Resource#userAgentNeedsUpdate} on the wrapped {@link
 * ResourceHandler} object.</p>
 */
@Override
public boolean userAgentNeedsUpdate(FacesContext context) {
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: org.apache.myfaces.core.internal/myfaces-shaded-impl

public boolean userAgentNeedsUpdate(FacesContext context)
{
  return getWrapped().userAgentNeedsUpdate(context);
}

代码示例来源:origin: TheCoder4eu/BootsFaces-OSP

if (!resource.userAgentNeedsUpdate(context)) {
  externalContext.setResponseStatus(HttpServletResponse.SC_NOT_MODIFIED);
  return;

代码示例来源:origin: org.omnifaces/omnifaces

@Override
public void handleResourceRequest(FacesContext context) throws IOException {
  Resource resource = createResource(context);
  if (resource == null) {
    super.handleResourceRequest(context);
    return;
  }
  ExternalContext externalContext = context.getExternalContext();
  if (!resource.userAgentNeedsUpdate(context)) {
    externalContext.setResponseStatus(SC_NOT_MODIFIED);
    return;
  }
  InputStream inputStream = resource.getInputStream();
  if (inputStream == null) {
    externalContext.setResponseStatus(SC_NOT_FOUND);
    return;
  }
  externalContext.setResponseContentType(resource.getContentType());
  for (Entry<String, String> header : resource.getResponseHeaders().entrySet()) {
    externalContext.setResponseHeader(header.getKey(), header.getValue());
  }
  stream(inputStream, externalContext.getResponseOutputStream());
}

代码示例来源:origin: omnifaces/omnifaces

@Override
public void handleResourceRequest(FacesContext context) throws IOException {
  Resource resource = createResource(context);
  if (resource == null) {
    super.handleResourceRequest(context);
    return;
  }
  ExternalContext externalContext = context.getExternalContext();
  if (!resource.userAgentNeedsUpdate(context)) {
    externalContext.setResponseStatus(SC_NOT_MODIFIED);
    return;
  }
  InputStream inputStream = resource.getInputStream();
  if (inputStream == null) {
    externalContext.setResponseStatus(SC_NOT_FOUND);
    return;
  }
  externalContext.setResponseContentType(resource.getContentType());
  for (Entry<String, String> header : resource.getResponseHeaders().entrySet()) {
    externalContext.setResponseHeader(header.getKey(), header.getValue());
  }
  stream(inputStream, externalContext.getResponseOutputStream());
}

相关文章