import java.io.*; import javax.servlet.*;
import javax.servlet.http.*;
public class prog26 extends HttpServlet
{ public void doPost (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{ int x=10;
x = funcion1(x,20);
PrintWriter pagina;
response.setContentType("text/html");
pagina = response.getWriter();
pagina.println("<HTML>");
pagina.println("x="+x);
pagina.println("</HTML>");
pagina.close();
}; // termina dopost
public int funcion1(int a, int b){return a+b;};
public void destroy(){super.destroy();};
}// termina class
No hay comentarios:
Publicar un comentario