01: package example;
02:
03: import java.io.PrintWriter;
04: import java.io.IOException;
05:
06: import javax.servlet.ServletRequest;
07: import javax.servlet.ServletResponse;
08: import javax.servlet.GenericServlet;
09: import javax.servlet.ServletException;
10:
11: import javax.webbeans.In;
12:
13: /**
14: * The greeting client calls the GreetingAPI client.
15: */
16: public class GreetingClientServlet extends GenericServlet {
17: @In
18: private GreetingAPI _greeting;
19:
20: /**
21: * Runs the servlet
22: */
23: public void service(ServletRequest req, ServletResponse res)
24: throws IOException, ServletException {
25: PrintWriter out = res.getWriter();
26:
27: out.println("Greeting: " + _greeting.greeting());
28: }
29: }
|