Various Technologies Building Dynamic Web Application – Part I
A warm welcome to everyone who happen to be visiting my blog . Today I am going to dicuss about how various technologies sharpen through time for building robust , scalable, secure web application/websites. And also how data is generated dynamically. I have made and attempt to highlight the various technologies used and also tried to wrap the topic within four part series. And I will try to extend the series in future as time permits me.
There are several approaches/methods followed by different technologies for dynamic content generation in a website. But all these different technologies have one thing in common -After a request from the browser(Client End), these technologies using various methods and through logic generate HTML on the server and send it back to the requesting browser.
We can categorize dynamic technology into three broad types:
• Direct output
• Page scripting
• Hybrid
CGI and Java servlets are examples of the first type.
CGI (Common Gateway Interface) is the very first attempt at providing users with dynamic content. It allows users to execute a program that resides in the server to process data and even access databases in order to produce the relevant content.
How does CGI handles Client request:
In traditional CGI, a new process is started with each client request and this will correspond to initiating a heavy OS level process each time when a client request comes
A Java servlet is an implementation of Java that aims to provide the same service as CGI does, but instead of programs compiled in the native operating system, it compiles into the Java bytecode which is then run in the Java virtual machine. Though Java programs can be compiled into the native code, they still prefer to compile in the Java bytecode.
How does Java Servlet handles Client request:
In Java servlet, there is only a single instance, which answers all requests concurrently. This saves memory and allows a Servlet to easily manage persistent data.A simple JSP code as follows:
public class HelloWorld extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
{
response.setContentType(“text/html”);
PrintWriter out = response.getWriter();
out.println(“<html>”);
out.println(“<head><title>My First JSP Application</title></head>”);
out.println(“<body>”);
out.println(“<h1>Display Date</h1>”);
out.println(“Today’s date is : “);
java.util.Date aDate = new java.util.Date();
out.println(aDate.ToString());
out.println(“</body>”);
out.println(“</html>”);
}
}
However, its main drawback is that any change in the design of a Web page, no matter how minor, requires the intervention of a programmer, who must make the change, recompile the code, and perhaps turn off the server to deploy. For this reason, Web developers largely left the direct output approach behind when a new approach became available in the later 1990s with Microsoft’s ASP and the open-source PHP (PHP Hypertext Preprocessor).
Thanks for the article.
It was of great help