Skip to content
Permalink
Browse files

Added servlet annotation

  • Loading branch information...
tattwei46 committed Jul 8, 2019
1 parent 5ac749c commit 2a08c4d01b993d1ac42f43002d3ea5bcd6781372
@@ -4,15 +4,18 @@
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/helloworld")
public class HelloServlet extends HttpServlet {
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter();
out.println("<html><body><h1>Hello World</h1>");
out.println("<p>The time is " + new Date() + "</p>");

out.println("</body></html>");
out.close();
}
@@ -5,13 +5,4 @@
<web-app>
<display-name>Archetype Created Web Application</display-name>

<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>com.davidcheah.webapplication.servlet.HelloServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/helloworld</url-pattern>
</servlet-mapping>
</web-app>

0 comments on commit 2a08c4d

Please sign in to comment.
You can’t perform that action at this time.