JSP Tutorials Posted on: February 6, 2008 By Deepak Kumar
Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites.
JSP Tutorials
JSP Tutorials and examples, you will find many examples with
working source code.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
JSP PDF books
Collection is jsp books in the pdf format. You can download these books and
study it offline.
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.
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.
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.
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.
Connect JSP with mysql Now in the following jsp code, you will see
how to connect with the database.
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.
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.
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.
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.
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.
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:
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 TagLibrary(JSTL) and JavaServerFaces technology.
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.
Aswin
April 20, 2011
JSP
I studied about the architecture of JSP.But IF you have diagram for architecture then suggest me which one is Good for understand the concept very clearly
Thank You
pramoj
May 27, 2011
how to upload & down load a Pdf File Using java
I need this java code help me
Mahaboob Khan
May 28, 2011
Request for JSP Tutorials
Your site prvides an extra ordinary tutorials on the JSP.
manish
July 9, 2011
online shoping website development project
sir,
i am a student of b.tech.3rd yr after the completion of my 2nd yr summer training,a project is assigned to me to develope an online shoping website in JSP. so pleas sir give me lay out for creating website in JSP.
and some good links or some other resources from where i can get help during my project.
Apratibha Bhattacharya
July 4, 2011
need help
sir, I need a project on "payroll management system" using servlet or jsp & mysql.please help me sir.Actually it is my summer training project. so please please help me sir & I hope for your early reply.
soo
June 4, 2013
charts in jsp
hello everybody i need your help please i want to make a little program which draw charts in jsp by getting values from database ! something very simple like how much rows are insert in a table every day or week somthing like that ! and thanks you very much .
Parag Shirbhate
December 13, 2011
Web Development in JSP
I am making a web site that I required all material required for development. I am new to develop the the web site.
So please share all the required for this
prasad
December 28, 2011
file uploading
how to upload a file from a disk and store it in harddisk...................
Karthik
January 4, 2012
Thanks a lot
It has really helped me a lot. I don't even visit Google if i need any help in Java. I first visit roseindia.net.
chandana
March 13, 2012
jsp with multi record fields
Hi,
I have to write a JSP which has 20 fields.
And every time I enter the inputs in these fields it should get saved in a row format in the same page and i should be able to add more rows & edit the same.
pls can anybody tell me how this is done.
it will be really helpfull.
Regards,
Chandana
kaka profs
April 19, 2012
Problem need solution
A new bus company in town would like to know if it is making profits per day. The buses use a number of routes during the day. Different routes have different distances and so is the fuel consumption of the buses that work along these routes. A route is identified by route number e.g. route 001, route 002 etc, starting point and destination. One route can have up to 10 buses assigned. Each bus is identified by a number plate and route. Two employees are assigned to each bus per day. Whenever the bus moves from the source to the destination and back to the source, a round is counted. And for each and every round, each bus registers its collections (money) and fuel consumed. At the end of the day, the rounds that the bus made is computed and the total collections per bus is also computed. The total collection from all the routes is computed. Since the fuel is paid per month, the amount for the fuel is computed and deducted from the total collections. At the end of the day, each of the bus employees (2 per bus) gets a fraction of 40% of the remaining collections minus fuel deductions. Implement a system that solves the above problems that prints the following
How bus workers are required per day
How much will be required to pay bus workers
Which route is making the biggest profit
Which bus is making the least and which is making the highest profit
Enable user to search for the details of a given route e.g. the drivers on that route, source and destination, distance of route
Use (JSP, Servlets, html, Javascript for validation, CSS, MySQL database and any other techonology when picking data from the database only core tag libraries should be used. ). Design your own template using any software of your choice. You are required to present the png file of the template. You should also know how to slice the png file. Identify the components of the problem that can become beans for better reusability.....
help me out,pliz!!!
Keshava Valluri
June 3, 2012
Jsp
I want code for instant userid validation in jsp... plz help me ....
Mariausz
June 4, 2012
jsp fundamentals
very nice explanation...keep it up
Gourab Mukherjee
June 7, 2012
About href
Sir,how can a comment box can generate after just clicking the "comment" word(I mean to say that how can it be generated using jsp).
Chris Perera
June 25, 2012
Hi
I didn't get ideas about jsp form your tutorial your tutorials. I need to know how create very attractive jsp interface. How can I go to design view when I am designing interfaces???
vikas
August 17, 2012
mca
i have to lern
Jan
September 7, 2012
Email
Good Morning,
I'm creating a website and I want viewers to send me email from the website to my email straight. How can I do that because I checked your site it doesn't have what I want.
Can you pleas send me the code for that.
Thanks
Jan
eesh suneja
March 25, 2013
menu bar using struts
how can i show menu bar using struts
Arav
April 11, 2013
Remaining time showing on JSP page
Hello can any one help with to showing remainin time (not using js) on jsp page..and After finishing time it would lead me on another jsp page Pls Help
Ask Questions? Discuss: JSP Tutorials View All Comments
Post your Comment