Example usage for com.vaadin.server VaadinRequest getMethod

List of usage examples for com.vaadin.server VaadinRequest getMethod

Introduction

In this page you can find the example usage for com.vaadin.server VaadinRequest getMethod.

Prototype

public String getMethod();

Source Link

Document

Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.

Usage

From source file:annis.gui.requesthandler.BinaryRequestHandler.java

License:Apache License

@Override
public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)
        throws IOException {
    if (request.getPathInfo() != null && request.getPathInfo().startsWith(prefix)) {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            sendResponse(session, request, response, true);
            return true;
        } else if ("HEAD".equalsIgnoreCase(request.getMethod())) {
            sendResponse(session, request, response, false);
            return true;
        }//from www  .  ja v  a 2 s.co m
    }
    return false;
}

From source file:annis.gui.requesthandler.LoginServletRequestHandler.java

License:Apache License

@Override
public boolean handleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response)
        throws IOException {
    if (request.getPathInfo() != null && request.getPathInfo().startsWith(prefix)) {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(session, request, response);
            return true;
        } else if ("POST".equalsIgnoreCase(request.getMethod())) {
            doPost(session, request, response);
            return true;
        }//from w  w w .j  a va 2 s .  co  m
    }
    return false;
}