1# Hello World Example using Servlets 2 3This example uses Java Servlets instead of Netty for the gRPC server. This example requires `grpc-java` 4and `protoc-gen-grpc-java` to already be built. You are strongly encouraged to check out a git release 5tag, since these builds will already be available. 6 7```bash 8git checkout v<major>.<minor>.<patch> 9``` 10Otherwise, you must follow [COMPILING](../../COMPILING.md). 11 12To build the example, 13 141. **[Install gRPC Java library SNAPSHOT locally, including code generation plugin](../../COMPILING.md) (Only need this step for non-released versions, e.g. master HEAD).** 15 162. In this directory, build the war file 17```bash 18$ ../gradlew war 19``` 20 21To run this, deploy the war, now found in `build/libs/example-servlet.war` to your choice of servlet 22container. Note that this container must support the Servlet 4.0 spec, for this particular example must 23use `javax.servlet` packages instead of the more modern `jakarta.servlet`, though there is a `grpc-servlet-jakarta` 24artifact that can be used for Jakarta support. Be sure to enable http/2 support in the servlet container, 25or clients will not be able to connect. 26 27To test that this is working properly, build the HelloWorldClient example and direct it to connect to your 28http/2 server. From the parent directory: 29 301. Build the executables: 31```bash 32$ ../gradlew installDist 33``` 342. Run the client app, specifying the name to say hello to and the server's address: 35```bash 36$ ./build/install/examples/bin/hello-world-client World localhost:8080 37```