congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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