congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RequestContext.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.apache.wicket.RequestContext

Best Java code snippets using org.apache.wicket.RequestContext.get (Showing top 20 results out of 315)

origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * Factory method for creating header response
 * 
 * @return new header response
 */
protected IHeaderResponse newHeaderResponse()
{
  IHeaderResponse headerResponse = RequestContext.get().getHeaderResponse();
  if (headerResponse == null)
  {
    // no (portlet) headerResponse override, create a default one
    headerResponse = new HeaderResponse()
    {
      protected Response getRealResponse()
      {
        return HtmlHeaderContainer.this.getResponse();
      }
    };
  }
  return headerResponse;
}
origin: org.onehippo.cms7/hippo-cms-xinha-integration

public static final String encodeResourceURL(String url) {
  // if it is in portlet environment, just wrap the url in portlet resource url.
  RequestContext requestContext = RequestContext.get();
  if (requestContext.isPortletRequest()) {
    url = ((PortletRequestContext) requestContext).encodeResourceURL(url).toString();
    // use relative url (FIXME: why?)
    if (url.startsWith("http:") || url.startsWith("https:")) {
      int offset = url.indexOf('/', 8);
      if (offset != -1) {
        url = url.substring(offset);
      }
    }
  }
  return url;
}
origin: org.ops4j.pax.wicket/pax-wicket-service

realResponse.write("<span id=\"" + RequestContext.get().getNamespace() +
  "_embedded_head\" style=\"display:none\">");
realResponse.write(output);
origin: org.apache.wicket/com.springsource.org.apache.wicket

protected String getContextRelativeValue(String value)
{
  if ("href".equals(attribute) || "src".equals(attribute))
  {
    RequestContext rc = RequestContext.get();
    if (rc.isPortletRequest() &&
        !(value.startsWith("http://") || value.startsWith("https://")))
    {
      if ("href".equals(attribute))
      {
        value = ((PortletRequestContext)rc).encodeRenderURL(value).toString();
      }
      else
      {
        value = ((PortletRequestContext)rc).encodeSharedResourceURL(value).toString();
      }
    }
  }
  return value;
}
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Factory method for creating header response
 * 
 * @return new header response
 */
protected IHeaderResponse newHeaderResponse()
{
  IHeaderResponse headerResponse = RequestContext.get().getHeaderResponse();
  if (headerResponse == null)
  {
    // no (portlet) headerResponse override, create a default one
    headerResponse = new HeaderResponse()
    {
      @Override
      protected Response getRealResponse()
      {
        return HtmlHeaderContainer.this.getResponse();
      }
    };
  }
  return headerResponse;
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

realResponse.write("<span id=\"" + RequestContext.get().getNamespace() +
    "_embedded_head\" style=\"display:none\">");
realResponse.write(output);
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Checks if <code>value</code> represents a path and if it does transforms it into a relative
 * path
 * 
 * @param value
 * @return value as a relative path or untouched if not a path
 */
protected String getContextRelativeValue(String value)
{
  if ("href".equals(attribute) || "src".equals(attribute))
  {
    RequestContext rc = RequestContext.get();
    if (rc.isPortletRequest() &&
      !(value.startsWith("http://") || value.startsWith("https://")))
    {
      if ("href".equals(attribute))
      {
        value = ((PortletRequestContext)rc).encodeRenderURL(value).toString();
      }
      else
      {
        value = ((PortletRequestContext)rc).encodeSharedResourceURL(value).toString();
      }
    }
  }
  return value;
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

  public void sendRedirect(String redirectLocation) throws IOException
  {
    RequestContext rc = RequestContext.get();
    if (rc instanceof PortletRequestContext)
    {
      String wicketUrl = ((PortletRequestContext)rc).getLastEncodedPath(redirectLocation);
      if (wicketUrl != null)
      {
        redirectLocation = wicketUrl;
      }
      else
      {
        String contextPath = ((PortletRequestContext)rc).getPortletRequest()
            .getContextPath();
        if (redirectLocation.startsWith(contextPath + "/"))
        {
          redirectLocation = redirectLocation.substring(contextPath.length());
          if (redirectLocation.length() == 0)
          {
            redirectLocation = "/";
          }
        }
      }
    }
    super.sendRedirect(redirectLocation);
  }
}
origin: org.ops4j.pax.wicket/pax-wicket-service

RequestContext rc = RequestContext.get();
if (rc instanceof PortletRequestContext)
origin: org.ops4j.pax.wicket/pax-wicket-service

if (RequestContext.get().isPortletRequest())
origin: org.apache.wicket/com.springsource.org.apache.wicket

if (RequestContext.get().isPortletRequest())
origin: org.ops4j.pax.wicket/pax-wicket-service

public AppendingStringBuffer filter(AppendingStringBuffer responseBuffer)
{
  RequestContext rc = RequestContext.get();
  if (rc.isPortletRequest() && ((PortletRequestContext)rc).isEmbedded())
  {
    deleteFragment(responseBuffer, "<?xml", "?>");
    deleteFragment(responseBuffer, "<!DOCTYPE", ">");
    deleteOpenTag(responseBuffer, "html");
    deleteOpenTag(responseBuffer, "head");
    deleteOpenTag(responseBuffer, "body");
  }
  return responseBuffer;
}
origin: org.ops4j.pax.wicket/pax-wicket-service

RequestContext rc = RequestContext.get();
if (rc.isPortletRequest() && ((PortletRequestContext)rc).isEmbedded())
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * @see org.apache.wicket.IResponseFilter#filter(AppendingStringBuffer)
 */
public AppendingStringBuffer filter(AppendingStringBuffer responseBuffer)
{
  RequestContext rc = RequestContext.get();
  if (rc.isPortletRequest() && ((PortletRequestContext)rc).isEmbedded())
  {
    deleteFragment(responseBuffer, "<?xml", "?>");
    deleteFragment(responseBuffer, "<!DOCTYPE", ">");
    deleteOpenTag(responseBuffer, "html");
    deleteOpenTag(responseBuffer, "head");
    deleteOpenTag(responseBuffer, "body");
  }
  return responseBuffer;
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

if (redirectUrl.startsWith("/"))
  RequestContext rc = RequestContext.get();
  String continueTo = null;
  if (rc.isPortletRequest() && ((PortletRequestContext)rc).isEmbedded())
origin: org.apache.wicket/com.springsource.org.apache.wicket

if (form != null)
  RequestContext rc = RequestContext.get();
  if (rc.isPortletRequest())
origin: org.ops4j.pax.wicket/pax-wicket-service

if (form != null)
  RequestContext rc = RequestContext.get();
  if (rc.isPortletRequest())
origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see org.apache.wicket.behavior.AbstractAjaxBehavior#renderHead(org.apache.wicket.markup.html.IHeaderResponse)
 */
@Override
public void renderHead(IHeaderResponse response)
{
  super.renderHead(response);
  final IDebugSettings debugSettings = Application.get().getDebugSettings();
  response.renderJavascriptReference(WicketEventReference.INSTANCE);
  response.renderJavascriptReference(WicketAjaxReference.INSTANCE);
  if (debugSettings.isAjaxDebugModeEnabled())
  {
    response.renderJavascriptReference(JAVASCRIPT_DEBUG);
    response.renderJavascript("wicketAjaxDebugEnable=true;", "wicket-ajax-debug-enable");
  }
  RequestContext context = RequestContext.get();
  if (context.isPortletRequest())
  {
    response.renderJavascript("Wicket.portlet=true", "wicket-ajax-portlet-flag");
  }
}
origin: org.apache.wicket/com.springsource.org.apache.wicket

/**
 * @see org.apache.wicket.behavior.AbstractAjaxBehavior#renderHead(org.apache.wicket.markup.html.IHeaderResponse)
 */
public void renderHead(IHeaderResponse response)
{
  super.renderHead(response);
  final IDebugSettings debugSettings = Application.get().getDebugSettings();
  response.renderJavascriptReference(WicketEventReference.INSTANCE);
  response.renderJavascriptReference(WicketAjaxReference.INSTANCE);
  if (debugSettings.isAjaxDebugModeEnabled())
  {
    response.renderJavascriptReference(JAVASCRIPT_DEBUG);
    response.renderJavascript("wicketAjaxDebugEnable=true;", "wicket-ajax-debug-enable");
  }
  RequestContext context = RequestContext.get();
  if (context.isPortletRequest())
  {
    response.renderJavascript("Wicket.portlet=true", "wicket-ajax-portlet-flag");
  }
}
origin: org.ops4j.pax.wicket/pax-wicket-service

if (form != null)
  RequestContext rc = RequestContext.get();
  if (rc.isPortletRequest())
org.apache.wicketRequestContextget

Popular methods of RequestContext

  • isPortletRequest
  • encodeRenderURL
    Encodes URL's for render URLs, typically overridden by the portlet implementation.
  • encodeResourceURL
    Encodes URL's for resource targets, typically overridden by the portlet implementation.
  • encodeSharedResourceURL
    Encodes URL's for shared resource targets, typically overridden by the portlet implementation.
  • <init>
    Construct.
  • encodeMarkupId
    Encodes markup Ids, typically overridden by the portlet implementation.
  • getHeaderResponse
    Used to override response objects, typically used by the portlet implementation. In a Portlet envir
  • getNamespace
  • set
    Sets the RequestContext for the current threads active request.
  • unset
    Resets the RequestContext for the current threads active request.

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Notification (javax.management)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now