Java EE Tutorials Servlets Tutorials Servlets Interview Questions In this article we will write a simple program which will write content to a PDF file. Example of writing data into PDF using Servlet. Create a Servlet called PDFDemo. Explanation: Content-Disposition in response header contains inline disposition type and file name attributes. inline is disposition type. …
Servlets Tutorials
How To Initialize Variables In Servlet
Java EE Tutorials Servlets Tutorials Servlets Interview Questions While developing web applications (servlets), some data elements are required to process the request at the development phase. For example, in login application we need to enter user name and password. But user name and password are available only at the time of deploying the application. Instead …
ServletInputStream and ServletOutputStream
Java EE Tutorials Servlets Tutorials Servlets Interview Questions javax.servlet.ServletInputStream and javax.servlet.ServletOutputStream are abstract classes. These classes define several key methods that the other stream classes implement. Two of the most important methods are read( ) and write( ), which are used for reading the client request and writing servlet response to client respectively. ServletInputStream The …
Difference Between Forward And sendRedirect In Servlet
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 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 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 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
This tutorial post highlights the important difference between JSP and Servlet technologies. Servlet and JSP are the two key Java server side technologies that are building blocks for any of the Java web frameworks. It is important to know the difference between these two technologies. This is one of the fundamental concept that confuses the many …