Example usage for javax.servlet.http HttpServletResponse SC_OK

List of usage examples for javax.servlet.http HttpServletResponse SC_OK

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletResponse SC_OK.

Prototype

int SC_OK

To view the source code for javax.servlet.http HttpServletResponse SC_OK.

Click Source Link

Document

Status code (200) indicating the request succeeded normally.

Usage

From source file:com.nesscomputing.httpclient.testsupport.StringResponseConverter.java

public StringResponseConverter() {
    this(HttpServletResponse.SC_OK);
}

From source file:hr.diskobolos.config.security.authentication.CustomLogoutHandler.java

@Override
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
    Integer userId = Integer.valueOf(request.getParameter("userId"));
    logger.info("Prelogut actions for user with ID: " + userId);
    userService.preLogoutActions(userId);
    response.setStatus(HttpServletResponse.SC_OK);
}

From source file:com.thoughtworks.go.remote.work.HttpServiceStub.java

public HttpServiceStub() {
    this(HttpServletResponse.SC_OK);
}

From source file:nl.dtls.fairdatapoint.api.controller.utils.HttpHeadersUtils.java

/**
 * Set response header for the successful call
 * /* w  w  w .jav  a  2s . c o  m*/
 * @param responseBody ResponseBody
 * @param response  Http response
 * @param requesetedContentType Requeseted ContentType(i.e Accept header)
 */
public static void set200ResponseHeaders(String responseBody, HttpServletResponse response,
        RDFFormat requesetedContentType) {
    if (responseBody == null) {
        response.setStatus(HttpServletResponse.SC_NOT_FOUND);
        response.setContentType(MediaType.TEXT_PLAIN_VALUE);
    } else {
        response.setStatus(HttpServletResponse.SC_OK);
        response.setContentType(requesetedContentType.getDefaultMIMEType());
    }
}

From source file:com.intbit.util.ServletUtil.java

public static void printSuccessData(HttpServletResponse response, Map<String, Object> data) throws IOException {
    response.setStatus(HttpServletResponse.SC_OK);
    response.getWriter().write(AppConstants.GSON.toJson(data));
    response.getWriter().flush();/*from ww w.j a v  a  2s  .c  o  m*/
}

From source file:io.github.jhipster.security.AjaxAuthenticationSuccessHandler.java

@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {

    response.setStatus(HttpServletResponse.SC_OK);
}

From source file:com.skcraft.launcher.creator.server.PackagesHandler.java

public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {
    response.setContentType("text/plain; charset=utf-8");
    response.setStatus(HttpServletResponse.SC_OK);

    List<ManifestInfo> packages = Lists.newArrayList();
    PackageList packageList = new PackageList();
    packageList.setPackages(packages);// w w w  . j ava 2 s . co m

    File[] files = baseDir.listFiles(new PackageFileFilter());
    if (files != null) {
        for (File file : files) {
            Manifest manifest = mapper.readValue(file, Manifest.class);
            ManifestInfo info = new ManifestInfo();
            info.setName(manifest.getName());
            info.setTitle(manifest.getTitle());
            info.setVersion(manifest.getVersion());
            info.setLocation(file.getName());
            packages.add(info);
        }
    }

    mapper.writeValue(response.getWriter(), packageList);
    baseRequest.setHandled(true);
}

From source file:com.sentinel.rest.handlers.HttpLogoutSuccessHandler.java

@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {
    LOG.trace("Method: onLogoutSuccess called.");

    response.setStatus(HttpServletResponse.SC_OK);
    response.getWriter().flush();/*  www.ja va2s.c  o m*/

    LOG.trace("Method: onLogoutSuccess finished.");
}

From source file:org.fcrepo.integration.api.FedoraIdentifiersIT.java

@Test
public void testGetNextPidResponds() throws Exception {
    final HttpPost method = new HttpPost(serverAddress + "nextPID");
    method.addHeader("Accepts", "text/xml");
    logger.debug("Executed testGetNextPidResponds()");
    assertEquals(HttpServletResponse.SC_OK, getStatus(method));
}

From source file:es.ucm.fdi.dalgs.rest.security.RestLogoutSuccessHandler.java

@Override
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {
    response.setStatus(HttpServletResponse.SC_OK);
}