JSP Tutorials

Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites.

JSP Tutorials

JSP Tutorials


JSP Tutorials and examples, you will find many examples with working source code. JSP stands for Java Server Pages and is a technology to create dynamic web pages using Java technology. JSP allows you to embed the Java code in your HTML page. Basically JSP is simply a text file which contains HTML code and the Java code for easily creating the UI for web applications.

JSP pages are compiled into Java Servlet and then it runs on the Servlet enabled server. Every time you modify the JSP pages and installs on the server it recompiles the JSP page into Servlet. Here in this tutorial we have also explained you the life cycle of JSP pages.

Here in this section we have given large number of JSP articles that explains the JSP concepts with the help of example code. We have also explained how to run your JSP pages on the Tomcat Servlet container.

Here are the most complete tutorials collections of JSP:

  1. Introduction to JSP
    Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database driven web applications.
  2. JSP Tutorials - Introducing Java Server Pages Technology
    JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a portable, secure and well-defined way.
  3. JSP Architecture
    JPS pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled into a servlet by the JSP engine. Compiled servlet is used by the engine to serve the requests.
  4. JSP Actions
    In this section we will explain you about JSP Action tags and in the next section we will explain the uses of these tags with examples.
  5. Introduction to the JSP tags(This section also describe JSP Directives)
    In this lesson we will learn about the various tags available in JSP with suitable examples. In JSP tags can be devided into 4 different types.
  6. Detail introduction to JSP Declaratives
    JSP Declaratives begins with <%! and ends %> with .We can embed any amount of java code in the JSP Declaratives. Variables and functions defined in the declaratives are class level and can be used anywhere in the JSP page.
  7. Detail Introduction to JSP Scriptlets and JSP Expressions with examples
    JSP Scriptlets begins with <% and ends %> .We can embed any amount of java code in the JSP Scriptlets. JSP Engine places these code in the _jspService() method.
  8. Writing the Date JSP
    Till now you learned about the JSP syntax, now I will show you how to create a simple dynamic JSP page that prints the current date and time.
  9. Reading the Request Information
    When an HTTP client such as web browser sends a request to a wen server, along with the request it also sends some HTTP variables like Remote address, Remote host, Content type etc.
  10. Retrieving the data posted to a JSP file from HTML file
    Now I will show you how to retrieve the data posted from a HTML file in a JSP page. Consider an html page that prompts the user to enter his/her name, let's call it getname.htm.
  11. Accessing database from JSP
    In This article I am going to discuss the connectivity from MYSQL database with JSP.we take a example of Books database. This database contains a table named books_details.
  12. Implement JavaScript with JSP
    In this section we are going to implement  insert data, delete data, and update data using with JDBC database and also using of JavaScript.
  13. Working with JSP Sessions
    This JSP Tutorial shows you how to track the session between different JSP pages. In any web application user moves from one page to another and it becomes necessary to track the user data and objects throughout the application. JSP provide an implicit object "session", which can be use to save the data specific the particular to the user.
  14. JSP Cookies Example
    This tutorial shows how to handle cookies in JSP pages. In this tutorial you will learn how to add cookies through jsp page and then show the value of the same cookie in another JSP page.
  15. Cookie Example to Store and Show only 10 values
    This cookie example illustrates how you can manage cookie value in your JSP page. This example is saving and displaying cookies and also it is managing cookies size in such manner that if cookie size becomes greater than a limit (e.g 10 in this case), it will automatically deletes the oldest cookie from the list.
  16. Disabling Session in JSP
    In this tutorial you will learn how to disable session creation in the JSP pages. Disabling the session in some pages will improve the performance of your JSP container.
  17. JSP PDF books
    Collection is jsp books in the pdf format. You can download these books and study it offline.
  18. Free JSP Books
    Download the following JSP books.
  19. Free JSP Download
    BooksFree JSP Books for instant downloads.
  20. Authentication in Web Application
    In this example we will show you how to authenticated the user against database user name and password. This program consists of a JSP page and a Servlet to authenticate the user against database password.
  21. Calling Servlet to build a List of data from database and show this on the JSP page in table
    In this example we are calling a servlet to retrieve all the data from database and then add the data into list. The list is then added to the request object and sen to JSP page. On the JSP page this value is displayed.
  22. Access all the fields from table through JSP
    This is detailed java program to connect java application with MySql database and execute query to display data from the specified table. Before running this java code you need mysql-connector-java-3.1.6-bin.jar file and set class path to this file.
  23. Use Break Statement in jsp code
    The break statement is used to terminate the execution of near most enclosing loop or conditional statement. Now the next statement outside the loop is executed.
  24. Use Compound Statement in JSP Code
    A compound statement is collection of statements enclosed with in braces. In general, statement works without braces but it only execute single statement and rest of the statements takes as normal statement and execute them.
  25. Connect JSP with mysql
    Now in the following jsp code, you will see how to connect with the database.
  26. Create a Table in Mysql database through SQL Query in JSP
    This is detailed java code to connect a jsp page to mysql database and create a table of given name in the specified database.
  27. Create dynamic page through JSP
    This is detailed jsp code that shows how to create dynamic page. This code shows one by one record of student from database on click a button named 'next record'. On each click of button, application fetch next record from database.
  28. Retrieve image from mysql database through jsp
    In this section we will see how to retrieve image from MySQL database through jsp code.
  29. How To Page Refresh Using JavaScript  In JSP
    In this section, we develop an User Login application . We created five file sign.jsp,signout.jsp,user_register.jsp,userlogin.jsp and useradd.jsp. 
  30. Display Sum of Table Column Using In JSP
    In this section, we develop an application to Display the sum data of a Table column for a specific Date. We created five file sum_count.jsp, resultForm.jsp, result_count.jsp, sumcount.java and SumCountBean.java
  31. Combo Box Using Ajax In JSP
    In this section, we develop an  application to Select the Data from database using Ajax in combo box. We created two file combo.jsp and getuser.jsp.
  32. To Upload and insert the file Into Database with Current Date and Time In JSP
    In this tutorial, you will learn how to upload a file through JSP and insert it into the database. For this, we have created two jsp pages page.jsp and upload_page.jsp
  33. Calendar In JSP Using JavaScript
    In this section, we develop a Calendar application in JSP using JavaScript.
  34. Popup Window using Ajax In JSP
    In this section, we will develop a Popup Window application using Ajax in JSP.
  35. User Registration Form Using JSP(JspBeans)
    In this section you will learn about the handling of user registration form using jsp. One of the basic programming tactics of jsp is to assign as much processing as possible to java Bean component.
  36. Login Authentication using Bean and Servlet In JSP
    In this section, we have developed a web application of login authentication using Bean  in JSP.  
  37. Record user login and logout timing In JSP
    In this section, we have developed a web application of maintain record of the user Login and Logout Time  in JSP. 
  38. Retrieve Data from CSV file in JSP 
    In this section, we have developed a web application of maintain record of the user Login and Logout Time  in JSP.
  39. Export Data into CSV file uing JDBC in JSP         
    In this section, you will learn how to export data into CVS file using JDBC in jsp.
  40. Download CSV File from Database in JSP  
    In this section, you will learn how to download CSV  file from database in JSP.  In this example, we have developed two files "viewcsv.jsp" and "file_download.jsp" , code is given below.

JSP Versions:

    1. Features of JSP 2.1
      The main purpose of Java Platform,  Enterprise Edition (Java EE) 5 is to ease development. Now the Jsp2.1 includes the Java Standard Tag Library(JSTL) and JavaServerFaces technology.
    2. New Features in JSP 2.0
      In this tutorial you will know the features added in JSP 2.0.
    3. Difference between JSP 2.0 & JSP 2.1
      In this tutorial you will find the basic difference between JSP 2.0 and JSP 2.1.
Comments on this article may be sent to: [email protected]
    2. JSTL tags in the core-group
    3. JSTL XML Tags
    4. SQL tags in JSTL
JSP Fundamentals
This is an excellent tutorial on JSP for the beginners. Tutorial describes how to use Bean in JSP, Connection Pooling in JSP and the use of taglibs. 
    • JSP Fundamentals
      JSP termed as Java Server Pages is a technology introduced by Sun Microsystems Inc. to develop the web application in more efficient way than Servlets. It has got many advanced features than servlets, one of them itself define the JSP i.e. JSP separates the presentation logic from the business logic and provide the designer and developer of the web application to work independently without any hassle.
    • Using Beans in JSP
      Java Beans are reusable components. They are used to separate Business logic from the Presentation logic. Internally, a bean is just an instance of a class.
    • JSP Taglibraries
      JSP?s offer a unique feature of "Tag Libraries". Simply put, these are custom defined JSP tags. They are basically meant for componentizing presentation level logic. They are very similar to beans except the fact that Beans are used to separate Business logic.

JSP Tutorials Pages: JSP Tutorials Page 1 | JSP Tutorials Page 2 | JSP Tutorials Page 3