Created
May 6, 2013 16:00
-
-
Save regispires/5526062 to your computer and use it in GitHub Desktop.
Um simples Servlet Hello World...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.ufc.dsweb; | |
import java.io.IOException ; | |
import java.io.PrintWriter ; | |
import javax.servlet. ServletException ; | |
import javax.servlet.annotation.WebServlet ; | |
import javax.servlet.http.HttpServlet ; | |
import javax.servlet.http.HttpServletRequest ; | |
import javax.servlet.http.HttpServletResponse ; | |
@WebServlet ("/oi") | |
public class HelloWorldServlet extends HttpServlet { | |
@Override | |
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException , IOException { | |
PrintWriter writer = resp.getWriter(); | |
writer.println ("<html><body><h1>Olá Mundo</h1></body></html>"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment