Difference Between Forward And sendRedirect In Servlet

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions First let us list the differences between the forward() and sendRedirect() methods. Then we will see an example for each: forward() sendRedirect() The forward() method is executed in the server side. The sendRedirect() method is executed in the client side. The request is transfer to other resource […]

HTTP Status Codes

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions Hypertext Transfer Protocol (HTTP) is an application-level protocol for common hypermedia information systems. It is a request/response protocol between clients and servers. It is a generic stateless protocol, used to transfer hypertext. HTTP Status Codes Status Codes are used by the client application to know the status […]

SingleThreadModel In Servlet

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions The SingleThreadModel interface was designed to guarantee that only one thread is executed at a time in a given servlet instance’s service method. It is a marker interface and has no methods. This interface is currently deprecated, excerpts from the Java Doc: Deprecated. As of Java Servlet API […]

MVC Architecture Using Servlet And JSP

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions Web Architecture Models Different programmers may design an application in different ways. Designing an application depends on how the programmers recognize the problem and approaches for solving that problem. A development model facilitates the design process by separating the code according to the functions performed by different […]

Difference Between Servlet and JSP

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions In this article we will list some of the differences between Servlet and JSP Servlet JSP A servlet is a server-side program JSP is an interface on top of Servlets Executes inside a Web server, such as Tomcat A JSP program is compiled into a Java servlet […]

ServletConfig in Servlet

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions In this article we will see about ServletConfig Interface and how it works. The config object is created by the web container based on the initialization parameters specified in the deployment descriptor. It is used to send information to a servlet during initialization. Now let see the […]

sendRedirect in Servlet

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions In this article we shall see how to redirect your current page to some other page. The easiest way to achieve this is by using the sendRedirect() method of class javax.servlet.http.HttpServletResponse. sendRedirect() method redirects your current page to another servlet or jsp page. This method is used […]

Request Dispatcher In Servlet

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions Request Dispatcher While developing web applications we need to distribute the request processing and response generation to multiple servlet objects. So we need to dispatch requests from one component to another component. This can be done by using RequestDispatcher interface. RequestDispatcher interface is implemented by servlet container […]

Servlet Context

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions Servlet Context is used to communicate with the servlet container to get the details of web application. It is created at the time of deploying the project. There is only one Servlet Context for entire web application. Servlet Context parameter uses <context-param> tag in web.xml file. Methods of […]

Web.xml

java-ee-thumbnail

Java EE Tutorials Servlets Tutorials Servlets Interview Questions To understand web.xml, first let us uderstand what is xml? xml stands Extensible Markup Language. xml is markup language much like html. Xml defines set of rules for encoding document in a format that readable by both as human and machine. Xml was designed to carry and […]