import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,IOException{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<html>");
pw.println("<head><title>Hello World</title></title>");
pw.println("<body>");
pw.println("<h1>Hello World</h1>");
pw.println("</body></html>");
}
}
how this program is done by the doPost method.........
yes this is good but i m trying to implement same...
but i got error
HTTP Status 404 - /demo_examples/HelloWorld
type Status report
message /demo_examples/HelloWorld
description The requested resource (/demo_examples/HelloWorld) is not available.
plz solve my problem
please tell me where we want to save the programanu March 30, 2011 at 10:44 PM
hi am geeting error source not found. wer we deploye the .class file plz tell me thanq
Small mistake in ProgramNagesh April 19, 2011 at 11:36 AM
pw.println("<head><title>Hello World</title></title>"); in this line you did not closed the <head>. you have closed <title> two times.
servletmanikandan November 29, 2011 at 1:04 PM
this is site of very usefull in all it employess...
servlet post methodjignesh January 6, 2012 at 1:35 PM
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{ response.setContentType("text/html"); PrintWriter pw = response.getWriter(); pw.println("<html>"); pw.println("<head><title>Hello World</title></title>"); pw.println("<body>"); pw.println("<h1>Hello World</h1>"); pw.println("</body></html>"); } } how this program is done by the doPost method.........
servletrenuka January 11, 2012 at 10:52 AM
yes this is good but i m trying to implement same... but i got error HTTP Status 404 - /demo_examples/HelloWorld type Status report message /demo_examples/HelloWorld description The requested resource (/demo_examples/HelloWorld) is not available. plz solve my problem
servletsreelu January 12, 2012 at 1:38 PM
i have compiled and executed servlet program but it is not getting executed.. i dont know the reason
The CodeKeith January 16, 2012 at 1:40 AM
On the first picture of code, there's a typo. The println method has 2 closing title tags
articleemem April 2, 2012 at 10:13 PM
thanks for the article :)
ThanksAnubhav April 14, 2012 at 5:12 AM
Thank you very much
About saranya May 23, 2012 at 5:06 PM
It is very useful to study.
Post your Comment