import
java.io.*;
import
java.net.*;
importjavax.servlet.*;
importjavax.servlet.http.*;
public
class NewServlet extends HttpServlet
{
protected
void doGet(HttpServletRequest request, HttpServletResponse response)
throwsServletException,
IOException
{
//processRequest(request, response);
response.setContentType("text/html;charset=UTF-8");
PrintWriter
out = response.getWriter();
Try
{
// TODO output your page here
out.println("<html>");
out.println("<head>");
out.println("</head>");
out.println("<body>");
out.println("<h1>This
is my first servlet</h1>");
out.println("<p>SarvodayPolitechnic
Institute</p>");
out.println("</body>");
out.println("</html>");
}
finally
{
out.close();
}
}
Output:
No comments:
Post a Comment