Tabnine Logo
Request.getServletRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
getServletRequest
method
in
leap.web.Request

Best Java code snippets using leap.web.Request.getServletRequest (Showing top 9 results out of 315)

origin: org.leapframework/leap-webapi

@Override
public String getHost() {
  return request.getServletRequest().getServerName();
}
origin: org.leapframework/leap-webapi

@Override
public int getPort() {
  return request.getServletRequest().getServerPort();
}
origin: org.leapframework/leap-webapi

public static String formatApiEndPoint(String apiEndPoint) {
  if (apiEndPoint.contains("{context}")) {
    String contextPath = Request.tryGetCurrent().getServletRequest().getContextPath();
    apiEndPoint = apiEndPoint.replace("{context}", Strings.trimStart(contextPath, '/'));
    //apiEndPoint=apiEndPoint.replace("//", "/");
  }
  if (apiEndPoint.contains("~")) {
    HttpServletRequest request = Request.tryGetCurrent().getServletRequest();
    apiEndPoint = apiEndPoint.replace("~", Strings.format("{0}://{1}:{2}", request.getScheme(), curServerLocalIp(), request.getLocalPort()));
  }
  if (apiEndPoint.startsWith("/")) {
    HttpServletRequest request = Request.tryGetCurrent().getServletRequest();
    apiEndPoint = Strings.format("{0}://{1}:{2}", request.getScheme(), "127.0.0.1", request.getLocalPort()) + apiEndPoint;
  }
  if (Strings.endsWith(apiEndPoint, "/")) {
    apiEndPoint = Strings.trimEnd(apiEndPoint, '/');
  }
  return apiEndPoint;
}
origin: org.leapframework/leap-oauth2-webapp

@Override
public Token extractTokenFromRequest(Request request) {
  String v = extractToken(request.getServletRequest());
  return extractTokenFromString(v,request.getParameters());
}
origin: org.leapframework/leap-oauth2

@Override
public ResAccessToken extractTokenFromRequest(Request request) {
  String v = extractToken(request.getServletRequest());
  return extractTokenFromString(v,request.getParameters());
}
origin: org.leapframework/leap-oauth2-webapp

protected String buildClientRedirectUri(Request request) {
  String uri;
  //todo: reverse proxy
  String redirectUri = config.getRedirectUri();
  if (Strings.isEmpty(redirectUri)) {
    uri = request.getServletRequest().getRequestURL().toString();
  }else{
    if(Strings.startsWithIgnoreCase(redirectUri,"http")) {
      uri = redirectUri;
    }else{
      uri = request.getContextUrl() + redirectUri;
    }
    String returnUrl = sc.getReturnUrlParameterName() + "=" + Urls.encode(request.getUri());
    uri = Urls.appendQueryString(uri, returnUrl);
  }
  String redirectBack = REDIRECT_BACK_PARAM + "=1";
  return Urls.appendQueryString(uri, redirectBack);
}
origin: org.leapframework/leap-websecurity

@Override
public State preExecuteAction(ActionContext context, Validation validation) throws Throwable {
  if(!isEnabled(context)) {
    return State.CONTINUE;
  }
  
  Request request = context.getRequest();
  
  //Ignore GET request
  if(request.isMethod(HTTP.Method.GET)) {
    return State.CONTINUE;
  }
  
  //Check ignored
  if(CSRF.isIgnored(request.getServletRequest())) {
    return State.CONTINUE;
  }
  
  CsrfToken token = CSRF.getGeneratedToken(request);
  
  checkCsrfToken(request, token);
  
  return State.CONTINUE;
}

origin: org.leapframework/leap-oauth2-webapp

CSRF.ignore(request.getServletRequest());
origin: org.leapframework/leap-oauth2

CSRF.ignore(request.getServletRequest());
leap.webRequestgetServletRequest

Popular methods of Request

  • getHeader
  • getParameter
  • getAttribute
  • getContextPath
  • getPath
  • setAttribute
  • forwardToView
  • getMessageSource
  • getMethod
  • getSession
  • getUri
  • getValidation
  • getUri,
  • getValidation,
  • tryGetCurrent,
  • getCharacterEncoding,
  • getContextUrl,
  • getLocale,
  • getParameters,
  • getQueryString,
  • getUriWithQueryString

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • scheduleAtFixedRate (Timer)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Reference (javax.naming)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim plugins
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