This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Tu IP es: %s", your_add); printf(""); printf(""); }
41
2.7.2 Servlets Los Servlets son módulos de código, normalmente en lenguaje Java, pero pueden encontrarse en algún otro como Python (Zope http://www.zope.org), que se ejecutan dentro de un servidor de aplicaciones (motor de Servlets) para responder a las peticiones de los sistemas cliente. Algorithm 2 Servlet en lenguaje Java import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloClientServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("
Tu IP es: $c->remote_ip
"); $r->print(""); $r->print(""); return OK; } 1;