@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/5066")
public class GrpcServlet
extends javax.servlet.http.HttpServlet
asyncSupported to true. The /contextRoot/urlPattern must match the gRPC services' path, which is
"/full-service-name/short-method-name".
The API is experimental. The authors would like to know more about the real usecases. Users are welcome to provide feedback by commenting on the tracking issue.
| Constructor and Description |
|---|
GrpcServlet(List<? extends io.grpc.BindableService> bindableServices)
Instantiate the servlet serving the given list of gRPC services.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic GrpcServlet(List<? extends io.grpc.BindableService> bindableServices)
ServerInterceptors.intercept(BindableService, io.grpc.ServerInterceptor...)protected final void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doGet in class javax.servlet.http.HttpServletIOExceptionprotected final void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
doPost in class javax.servlet.http.HttpServletIOExceptionpublic void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServlet