Pages

Thursday, February 21, 2013

Printing output to the browser using Servlets


In general the output is printed to the Apache Command Line but if we want to print the output to the Web Browser we will use the PrintWriter class declared in the java.io.* package.

Steps to deploy a project developed using Servlets



Following are the steps to deploy a project in the server. We use Apache Tomcat and the folder to place the project folder is usually C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps

Servlet Interface, Methods and Important Notes about Servlets


Servlet is an interface available in two packages javax.servlet.*; and javax.servlet.http;
Servlets are generally implemented using 3 ways:

Writing the Deployment Descriptor i.e., web.xml for Servlets


Web.xml is the deployment descriptor i.e., it describes all the classes being used in the project. It is the first file checked by the server and if not present then the output is not obtained.

Project Hierarchy when using Servlets



As we are dealing with projects in Servlets we follow a standard hierarchy to make the server understands where to go and search when we work on the Servlets.

Applications needed to Work with Servlets

A servlet is used build Web Applications in simple words. In other words Servlet is a Java program executed on the server instead of a command line interface.

Friday, February 15, 2013

Increment and Decrement Operators in Java



Operators are of various types in Java and of them increment and decrement operators are special ones with much more complex functionality with pre and post types. In this post, you will understand various ways on how these operators perform depending on the usage.