Example usage for javax.servlet.http HttpServletResponse SC_NOT_IMPLEMENTED

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

Introduction

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

Prototype

int SC_NOT_IMPLEMENTED

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

Click Source Link

Document

Status code (501) indicating the HTTP server does not support the functionality needed to fulfill the request.

Usage

From source file:org.shredzone.commons.captcha.CaptchaServlet.java

@Override
protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (!request.getMethod().equals("GET")) {
        response.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, request.getMethod() + " is not accepted");
    }/*from w  w  w .j a  v a  2s  . c  om*/

    // Prepare header
    response.setDateHeader("Date", System.currentTimeMillis());
    response.setHeader("Cache-Control", "no-store");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", 0);
    response.setContentType("image/png");

    // Write captcha image
    CaptchaService cs = getWebApplicationContext().getBean("captchaService", CaptchaService.class);
    BufferedImage challenge = cs.createCaptcha(request.getSession());
    ImageIO.write(challenge, "png", response.getOutputStream());
}

From source file:org.apache.ambari.server.api.services.UserPrivilegeService.java

@Override
public Response createPrivilege(String body, HttpHeaders headers, UriInfo ui) {
    return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).build();
}

From source file:org.apache.ambari.server.api.services.UserPrivilegeService.java

@Override
public Response updatePrivilege(String body, HttpHeaders headers, UriInfo ui, String privilegeId) {
    return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).build();
}

From source file:org.apache.ambari.server.api.services.UserPrivilegeService.java

@Override
public Response updatePrivileges(String body, HttpHeaders headers, UriInfo ui) {
    return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).build();
}

From source file:com.homesnap.webserver.LabelRestAPITest.java

@Test
public void test2CreateLabelList() {
    // Test impossible to create label list
    postRequestJSONObject(urn_labels, "{}", HttpServletResponse.SC_NOT_IMPLEMENTED);
}

From source file:de.mpg.escidoc.services.pidcache.web.MainServlet.java

protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, "DELETE method not supported for this service.");
}

From source file:org.apache.ambari.server.api.services.UserPrivilegeService.java

@Override
public Response deletePrivilege(HttpHeaders headers, UriInfo ui, String privilegeId) {
    return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).build();
}

From source file:com.homesnap.webserver.GroupRestAPITest.java

@Test
public void test1CreateGroupList() {
    // Test impossible to create grouplist
    postRequestJSONObject(urn_groups, "{}", HttpServletResponse.SC_NOT_IMPLEMENTED);
}

From source file:org.apache.ambari.server.api.services.UserPrivilegeService.java

@Override
public Response deletePrivileges(String body, HttpHeaders headers, UriInfo ui) {
    return Response.status(HttpServletResponse.SC_NOT_IMPLEMENTED).build();
}

From source file:com.homesnap.webserver.HouseRestAPITest.java

@Test
public void test2CreateHouse() {
    // Test impossible to create a house
    JSONObject o = postRequestJSONObject(urn, "{}", HttpServletResponse.SC_NOT_IMPLEMENTED);
    Assert.assertEquals(null, o);/*from ww w  .  jav a2 s  .  c  om*/
}