import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.PrintWriter;
import java.io.IOException;
public class OurFirstServlet extends HttpServlet
{
public void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/HTML");
PrintWriter out = response.getWriter();
out.println("< HTML >");
out.println("< head >< title >Servlet Example " +
" ");
out.println("< body >");
out.println("Not Much code, but this is enough for a Servlet.");
out.println("");
out.println("");
}
}
The above is a simple Servlet. It would display an almost blank HTML page that contains the message we put in "Not Much code, but this is enough for a Servlet."
barsanabegam
i dont no string for servlate
Andrea Steelman has written: 'Murach's Java servlets and JSP' -- subject(s): Java (Computer program language), JavaServer pages, Servlets
Marty Hall has written: 'More servlets and JavaServer pages' -- subject(s): Active server pages, Java (Computer program language), Servlets
Yes. It is very suitable and in fact Servlets are based on the Java Technology and the Java Development Kit (JDK) is used for the same
yes ,i can add the website link in java program when we write.
J2SE stands for Java 2 Standard Edition and I dont think Servlets are a part of it. Servlets are only part of the Java 2 Enterprise Edition.
using servlets, php, and database we can connect import codes into java
Exactly what do you mean by 'C program in Java'
JSPs can contain HTML, JavaScript, XML and Java Code whereas Servlets can contain only Java Code, making JSPs more flexible and powerful than Servlets. However, Servlets have their own place in a J2EE application and cannot be ignored altogether. They have their strengths too which cannot be overseen.
write a java program to display "Welcome Java" and list its execution steps.
\n