javax.faces.context.Flash.setRedirect()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(162)

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

Flash.setRedirect介绍

[英]Setting this property to true indicates that the next request on this session will be a redirect. Recall that on a redirect, the server sends a special response to the client instructing it to issue a new request to a specific URI. The implementation must insure that reading the value of this property on that request will return true.
EL Usage Example

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> 
<!-- extra code removed --> 
<c:set target="#{flash}" property="redirect" value="true" />

[中]将此属性设置为true表示此会话上的下一个请求将是重定向。回想一下,在重定向时,服务器向客户端发送一个特殊响应,指示它向特定URI发出新请求。实现必须确保在该请求上读取此属性的值将返回true
EL使用示例

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> 
<!-- extra code removed --> 
<c:set target="#{flash}" property="redirect" value="true" />

代码示例

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 * 
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

@Override
public void setRedirect(boolean newValue)
{
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * <p class="changed_added_2_2">The default behavior of this method
 * is to call {@link Flash#setRedirect(boolean)} on the wrapped
 * {@link Flash} object.</p>
 *
 * @since 2.2
 */
@Override
public void setRedirect(boolean newValue) {
  getWrapped().setRedirect(newValue);
}

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

/**
 * @see Faces#redirect(String, String...)
 */
public static void redirect(FacesContext context, String url, String... paramValues) {
  ExternalContext externalContext = context.getExternalContext();
  externalContext.getFlash().setRedirect(true); // MyFaces also requires this for a redirect in current request (which is incorrect).
  try {
    externalContext.redirect(prepareRedirectURL(getRequest(context), url, paramValues));
  }
  catch (IOException e) {
    throw new UncheckedIOException(e);
  }
}

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

/**
 * @see Faces#redirect(String, String...)
 */
public static void redirect(FacesContext context, String url, String... paramValues) {
  ExternalContext externalContext = context.getExternalContext();
  externalContext.getFlash().setRedirect(true); // MyFaces also requires this for a redirect in current request (which is incorrect).
  try {
    externalContext.redirect(prepareRedirectURL(getRequest(context), url, paramValues));
  }
  catch (IOException e) {
    throw new UncheckedIOException(e);
  }
}

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

/**
 * @see Faces#redirectPermanent(String, String...)
 */
public static void redirectPermanent(FacesContext context, String url, String... paramValues) {
  ExternalContext externalContext = context.getExternalContext();
  externalContext.getFlash().setRedirect(true); // MyFaces also requires this for a redirect in current request (which is incorrect).
  externalContext.setResponseStatus(SC_MOVED_PERMANENTLY);
  externalContext.setResponseHeader("Location", prepareRedirectURL(getRequest(context), url, paramValues));
  externalContext.setResponseHeader("Connection", "close");
  context.responseComplete();
}

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

/**
 * @see Faces#redirectPermanent(String, String...)
 */
public static void redirectPermanent(FacesContext context, String url, String... paramValues) {
  ExternalContext externalContext = context.getExternalContext();
  externalContext.getFlash().setRedirect(true); // MyFaces also requires this for a redirect in current request (which is incorrect).
  externalContext.setResponseStatus(SC_MOVED_PERMANENTLY);
  externalContext.setResponseHeader("Location", prepareRedirectURL(getRequest(context), url, paramValues));
  externalContext.setResponseHeader("Connection", "close");
  context.responseComplete();
}

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

flash.setRedirect(true);
  extContext.redirect(redirectUrl);
} catch (java.io.IOException ioe) {

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

flash.setRedirect(true);
  extContext.redirect(redirectUrl);
} catch (java.io.IOException ioe) {

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

flash.setRedirect(true);
  extContext.redirect(redirectUrl);
} catch (java.io.IOException ioe) {

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

flash.setRedirect(true);
  extContext.redirect(redirectUrl);
} catch (java.io.IOException ioe) {

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

externalContext.getFlash().setRedirect(true);
try

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

externalContext.getFlash().setRedirect(true);
try

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

externalContext.getFlash().setRedirect(true);
try

相关文章