/** * * @since 2.1 * @return */ public boolean isSecure() { ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get(); if (ctx == null) { throw new UnsupportedOperationException(); } return ctx.isSecure(); }
/** * <p class="changed_added_2_1">Returns a boolean indicating whether this request * was made using a secure channel, such as HTTPS. * * * <p><em>Servlet:</em> This must return the result of calling * <code>isSecure</code> on the underlying * <code>javax.servlet.http.HttpServletRequest</code> instance.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * @since 2.1 */ public boolean isSecure() { if (defaultExternalContext != null) { return defaultExternalContext.isSecure(); } else { throw new UnsupportedOperationException(); } }
/** * <p class="changed_added_2_1">Returns a boolean indicating whether this request * was made using a secure channel, such as HTTPS. * * * <p><em>Servlet:</em> This must return the result of calling * <code>isSecure</code> on the underlying * <code>javax.servlet.http.HttpServletRequest</code> instance.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * @return the boolean indicating whether this request is secured. * * @since 2.1 */ public boolean isSecure() { if (defaultExternalContext != null) { return defaultExternalContext.isSecure(); } else { throw new UnsupportedOperationException(); } }
/** * <p class="changed_added_2_1">Returns a boolean indicating whether this request * was made using a secure channel, such as HTTPS. * * * <p><em>Servlet:</em> This must return the result of calling * <code>isSecure</code> on the underlying * <code>javax.servlet.http.HttpServletRequest</code> instance.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * @return the boolean indicating whether this request is secured. * * @since 2.1 */ public boolean isSecure() { if (defaultExternalContext != null) { return defaultExternalContext.isSecure(); } else { throw new UnsupportedOperationException(); } }
/** * <p class="changed_added_2_1">Returns a boolean indicating whether this request * was made using a secure channel, such as HTTPS. * * * <p><em>Servlet:</em> This must return the result of calling * <code>isSecure</code> on the underlying * <code>javax.servlet.http.HttpServletRequest</code> instance.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * @return the boolean indicating whether this request is secured. * * @since 2.1 */ public boolean isSecure() { if (defaultExternalContext != null) { return defaultExternalContext.isSecure(); } else { throw new UnsupportedOperationException(); } }
/** * <p class="changed_added_2_1">Returns a boolean indicating whether this request * was made using a secure channel, such as HTTPS. * * * <p><em>Servlet:</em> This must return the result of calling * <code>isSecure</code> on the underlying * <code>javax.servlet.http.HttpServletRequest</code> instance.</p> * * <p>The default implementation throws * <code>UnsupportedOperationException</code> and is provided * for the sole purpose of not breaking existing applications that extend * this class.</p> * * @return the boolean indicating whether this request is secured. * * @since 2.1 */ public boolean isSecure() { if (defaultExternalContext != null) { return defaultExternalContext.isSecure(); } else { throw new UnsupportedOperationException(); } }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
@Override public boolean isSecure() { return getWrapped().isSecure(); }
@Override public boolean isSecure() { return getWrapped().isSecure(); } }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
public static boolean isSecure(FacesContext fc){ //ICE-8902 //The isSecure() method is only available in JSF 2.1 which causes problems with older //versions of the two portlet bridges that don't override it. In that case, ignore the //exception and query the request via reflection to avoid any portlet runtime dependencies. try { return fc.getExternalContext().isSecure(); } catch (UnsupportedOperationException uoe) { //If isSecure is not overridden, then ignore and use the request directly. } return getSafeRequest(fc).isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * <p class="changed_added_2_2">The default behavior of this method is to * call {@link ExternalContext#isSecure} * on the wrapped {@link ExternalContext} object.</p> * */ @Override public boolean isSecure() { return getWrapped().isSecure(); }
/** * Creates a Cookie with the given name and value. * In addition, it will be configured with maxAge=-1, the current request path and secure value. * * @param name * @param value * @param externalContext * @return */ private Cookie _createFlashCookie(String name, String value, ExternalContext externalContext) { Cookie cookie = new Cookie(name, value); cookie.setMaxAge(-1); cookie.setPath(_getCookiePath(externalContext)); cookie.setSecure(externalContext.isSecure()); cookie.setHttpOnly(true); return cookie; }
private boolean isSecure(ExternalContext extContext) { // Bug 18611757: only use extContext.isSecure() if we // absolutely must. For example, if we are in a portlet // environment. boolean isSecure = false; Object request = extContext.getRequest(); if (request instanceof ServletRequest) { isSecure = ((ServletRequest)request).isSecure(); } else { try { isSecure = extContext.isSecure(); } catch (UnsupportedOperationException uoe) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.log(Level.SEVERE, "ExternalContext {0} does not implement isSecure(). Please implement this per the JSF 2.1 specification.", new Object [] { extContext }); } } } return isSecure; }
/** * Creates a Cookie with the given name and value. * In addition, it will be configured with maxAge=-1, the current request path and secure value. * * @param name * @param value * @param externalContext * @return */ private Cookie _createFlashCookie(String name, String value, ExternalContext externalContext) { Cookie cookie = new Cookie(name, value); cookie.setMaxAge(-1); cookie.setPath(_getCookiePath(externalContext)); cookie.setSecure(externalContext.isSecure()); //cookie.setHttpOnly(true); if (ServletSpecifications.isServlet30Available()) { _Servlet30Utils.setCookieHttpOnly(cookie, true); } return cookie; }