Services | Updates | Contact
Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML
Convert Text To XML
Here we are discussing the conversion of a text file into xml file by giving an example. This example creates an xml fil
 
Microsoft Blues
With the advent of Service Pack 2 for Windows XP operating system, Microsoft have really made the forums hum.
 
More Tutorials...


    Loan Information     Struts     Open Source

Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

 
 
Java Servlets

 
Comments
 
 

 

Java : Servlet Tutorials

                         

  1. History of  Web application
    Earlier in client- server computing, each application had its own client program and it worked as a user interface and need to be installed on each user's personal computer.
                                                           
  2. Introduction to Web Server
    A Web Server is a computer on the World Wide Web that stores Html documents that can be retrieved via a Web browser. It is a computer that delivers web pages.
                                                      
  3. What is a Container
    Container are nothing but a Java application which controls servlets. Tomcat is one of the example of a container. It is the container which calls the servlet's methods like doPost() and doGet().
                                                                     
  4. Overview of Servlets
    What is servlet?
                          
    Methods of Servlet

    Life Cycle of Servlet

    Features of Servlet 2.4 

    Features of Servlet 2.5

    Advantages of Java Servlets

    Advantages of Servlets over CGI
                      
  5. Quick get to Servlet
    Servlets overview
                             
    Introduction to Server Side programming
                                    
    Introduction to Java Servlets
                                    
    Installing Configuring and Running Servlets                                                                                          
                                                              
  6. How to run a Servlet?
    Install the tomcat server in a directory in which you want to install and set the classpath.for the variable JAVA_HOME in the environment variable.
                                                            
  7. Writing Hello World
    We should start understanding the servlets from the beginning. Lets start by making one program which will just print the "Hello World" on the browser. Each time the user visits this page it will display "Hello World" to the user.
                                              
  8. Displaying Date in Servlet
    In this example we are going to show how we can display a current date and time on our browser. It is very easy to display it on our browser by using the Date class of the java.util package.
                                                                                             
  9. Simple Counter In Servlet
    In this example we are going to know how we can make a program on counter which will keep track how many times the servlet has been accessed.
                                                                  
  10. A Holistic counter in Servlet
    In this program we are going to make a such a servlet which will count the number it has been accessed and the number of threads created by the server.
                                                                     
  11. Counter in Init() Method
    In this program we are going to make a such a servlet which will count and displays the number of times it has been accessed and by reading the init parameter to know from where the counting will begin.
                                                          
  12. Snooping the server
    To display the name of the server you are using use the method getServerName() of the ServletRequest interface. To display the server port number use the method getServerPort().
                                           
  13. Snooping Headers
    In this program we are going to going to make a servlet which will retrieve all the Http request header.
                                          
  14. Dice Roller
    We are going to make one program on the dice roller in which the number in the dice will be selected randomly. 
                                                                                     
  15. Getting Init Parameter Names
    Whenever the container makes a servlet it always reads it deployment descriptor file i.e. web.xml. Container creates name/value pairs for the ServletConfig object.  Once the parameters are in ServletConfig they will never be read again by the Container.
                                                                  
  16. Passing Parameter Using Html Form
    This is a very simple example in which we are going to display the name on the browser which we have entered from the Html page.
                                                                     
  17. Multiple values for a single parameter
    In our program it may be that we may have multiples values for a single parameter like in checkboxes.
                                                
  18. Time Updater in Servlet
    In this program we are going to make one program on servlet which will keep on updating the time in every second and the result will be displayed to you. 
                                                                         
  19. Send Redirect in Servlet 
    In this example we are going to make one html in which we will submit the user name and his password. The controller will check if the password entered by the user is correct or not.
                                                                                    
  20. Session Tracking
    As we know that the Http is a stateless protocol, means that it can't persist the information. It always treats each request as a new request. In Http client makes a connection to the server, sends the request., gets the response, and closes the connection.
                                                                                                                   
  21. To Determine whether the Session is New or Old
    In this program we are going to make one servlet on session in which we will check whether the session is new or old.
                                                                                   
  22. Pre- Existing Session
    In this example we are going to find out whether the session is pre- existing or not. 
                                                                                                                        
  23. Get Session Id
    In this example we are going to make a program in which we will find the session id which was generated by the container. 
                                                                           
    Connection with the Database
                                                                                               
  24. Inserting Data In Database table using Statement
    In this program we are going to insert the data in the database from our java program in the table stored in the database. 
                                                                                                                             
  25. Retrieving Data from the table using Statement
    In this program we are going to fetch the data from the database in the table from our java program.
                                
  26. Inserting data from the HTML page to the database
    In this program we are going to make program in which we are going to insert the values in the database table from the html form.
                                                 
  27. Retrieving Data from the table using PreparedStatement
    In this program we are going to fetch the data from the database in the table from our java program using PreparedStatement
                         
  28. Getting Columns Names using Servlets
    Consider a situation where there is a need to know about the name of the columns without touching our database. As we are the programmers so why we need to worry about the database.
                                  
  29. Getting Number of Columns
    Consider a situation where there is a need to know about the number of columns in the table without touching our database. As we are the programmers so why we should worry about the database.
                                 
  30. Getting Number of Rows
    Consider a situation where we want to know about the number of rows in the particular database table without touching our database.
    We want to find out the number of rows without going touching our back- end.
                                      
  31. Deleting Rows From Table
    Consider a situation where we have entered some wrong data and in later situation it starts giving problem to the organization.
                                               
  32. Deleting All Rows From the database Table
    Consider a situation where we have entered some wrong data and in later situation it starts giving problem to an organization or may become useless after sometime . Rather than go through with that data its better to delete that data.
                                                           
  33. How to add a column in a table
    Consider a situation where the requirement of the client gets changed and you have asked to modify the structure of the table. In reality it is the work of the database administrator but as a Java programmer you should know how you can modify the structure of the table.
                                             
  34. How to delete a table in mysql
    Consider a situation where we need to delete a table from a database.
                                                
  35. changing column name
    consider a scenario where we have a table and it consists some data and a situation arises where there is a need to change the name of the column.                       
                            
  36. insert into statement in sql using servlets
    In this tutorial we are going to learn how we can insert a value from a html form in the table stored in the database.   
                                                                                                                                         
  37. join tables mysql using servlets
    In this program we are going to join the two table by using the servlets and the result will be displayed in the browser.
                                                                                                                                                    
  38. Natural Left Join using servlets
    In this program we are going to join the two table by using the servlets and the result will be displayed in the browser. This join will be natural left join. 
                                                                                   
  39. Natural Right Join using servlets
    In this program we are going to join the two table by using the servlets and the result will be displayed in the browser. This join will be natural right join.
                                                                                                                                                                                         
  40. Difference between Servlet 2.4 and Servlet 2.5
    In this tutorial you will know  the difference between Servlet 2.4 and Servlet 2.5
                                                                                                                                                  
                                        
  41. Get And Post Method of Http
    The Get is one the simplest Http method. Its main job is to ask the server for the resource. The Post method is more powerful request. By using Post we can request as well as send some data to the server.
                                                                                                               
  42. Servlets Links
    Servlets are the Java platform technology of choice for extending and enhancing Web servers. Servlets provide a component-based, platform-independent method for building Web-based applications, without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are server- and platform-independent.
                                                                            
  43. Select Color
    In this program we are going to selected the various color and on the basis of the selection the output will be displayed to the user.
                                                                                                                          
  44. sendRedirect
    In send Redirect whenever the client makes any request it goes to the container, there the container decides whether the concerned servlet can handle the request or not. 
                                             
  45. Send Redirect in Servlet
    When we want that someone else should handle the response of our servlet, then there we should use sendRedirect() method.
                                       
  46. Random Redirector
    In this program we are going to make such a servlet which will be responsible to select a site randomly from the list of sites you have entered. Note that the selection of the site will be randomly.
                                                                      
  47. Servlet Context
    ServletContext is a interface which helps us to communicate with the servlet container. There is only one ServletContext for the entire web application and the components of the web application can share it.     
                                  
  48. Servlet Context Listener
    ServContextListener is a interface which contains two methods:
    public void contextInitialized(ServletContextEvent event) and
    public void contextDestroyed(ServletContextEvent event).
                                    
  49. ServletContextListener example
    ServletContextListener is notified when the context is initialized. It will be notified when the context is destroyed. It closes the database connection.
                                                                     
  50. ServletContextAttributeListener
    The listener ServletContextAttributeListener is an interface and extends the java.util.EventListener class. This listener come into existence when this interface receives notifications of changes to the attribute list on the servlet context of a web application.
                                                                           
  51. HttpSessionListener
    HttpSessionListener is an interface which extends java.util.EventListener class. The main purpose of this listener is to notify whenever there is a change in the list of active sessions in a web application..
                           
  52. HttpSessionListener example
    Before going into the details of the SessionListener we should firstly know about the sessions. Whenever a client makes a request for any resources to the server, the server receives the request and processes the request and sends back the response.
                      
  53. HttpSessionAttributeListener
    The listener HttpSessionAttributeListener is an interface and extends the java.util.EventListener class. This listener will be called by the container whenever there there will be change to the attribute list on the servlet session of a web application.
                           
  54. HttpSessionAttributeListener Example
    This listener is used when we want to know when a attribute has been added in a session, when a attribute has been removed and when it is replaced by another attribute.
                                     
  55. httpsessionbindinglistener
    HttpSessionBindingListener is a interface which extends java.util.EventListener interface. The purpose of the this interface is to notify an object when it is bound to or unbound from a session. 
                                                                    
  56. httpsessionbindinglistener example
    This interface has two methods: valueBound(HttpSessionBindingEvent event) and valueUnBound(HttpSessionBindingEvent event).
                               
  57. ServletRequestAttributeListener
    This listener is used when we want to know when a attribute has been added in a request, when a attribute has been removed and when it is replaced by another attribute.
                              
                        
  58. Inserting Image in a database Table
    Consider a case where we want that along with the name of the person and its information, his image should also come with all these things.
                                                                  
      
  59. say hello in spanish
    In this program we are going to display "hello" in spanish along with the date.   
                
  60. Accessing Date In Servlet
    In this example, we are going to show how we can display a creation date of the session and last accessed date or time and id on our browser. It is very easy to display it on our browser by using the Date class of the java.util package. 
                  
  61. Post Message In servlet
    In this example, we are going to implement posting massage to servlet. In the following program, you will learn how to post massage. 
            
  62. Show Parameter In Servlet
    In this section, you will learn how to send and put all parameter names into the table. The  following program uses two methods, which is described below.      

Quick Introduction to Java Servlet |

 

                         

Facing Programming Problem?
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

2 comments so far (post your own) View All Comments Latest 10 Comments:

although the matter is simple and sophisticated and eay to read but there is lack of explanations of all the matters in the website.it could have been more fine if the topic criteria is more widely displayed and explained.

Posted by yogesh on Tuesday, 02.19.08 @ 11:25am | #48971

I am really looking for more things from you

Posted by bala on Saturday, 04.21.07 @ 17:58pm | #14681

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.