JSP Tutorials - Page 3 Posted on: April 28, 2011 By Deepak Kumar
JSP Tutorials - Page 3
JSP Tutorials Page 3
Create Data Grid in
JSP page
This is detailed code that how to create data grid that shows data from
database table in jsp page. In this jsp code given below we have used a tag
library that provide some tags to create data grid.
Update Database Table using JDBC in
JSP This example shows how to update the existing record of mysql
table using jdbc connectivity in the jsp page. In this example we have
created two jsp pages update.jsp and
updatingDatabase.jsp.
Parsing The XML File using DOM parser in
JSP W3C (World Wide Web Consortium) started the
DOM (Document Object Model) parser, that is the platform independent and
language-neutral interface.
Parsing The
XML File Using JDOM Parser in JSP In this example we show how to work with JDOM parser to parse
the xml document. JDOM can read existing XML documents from files, network
sockets, strings, or from reader.
Implementing CSS and JavaScript in JSP File This example shows how to implement css and JavaScript in jsp.
Here we have created three main files that is cssScript.jsp,
validate.js and style.css.
Alphabetical DropDown Menu In JSP In this section, we have developed an
User Search application . We created five file
adduser.jsp, addform.jsp, userUpdate.jsp
and delete.jsp.
Using Bean
Counter in JSP In this section you will learn how the
counter bean can be used in jsp. As you all know a counter increments the
value by one. Here, we will use bean with a jsp .
Use
Constructor in JSP Constructors are used to initialize the
object. They are just like method declaration but they do not return value.
Constructors are defined by their class name.
Request Path in
JSP We are providing you an example which
shows the request path.The HTTPServletRequest interface provides
method getRequestURL().
Request
Parameters in JSP HttpServletRequest interface is
responsible for providing request parameters. Request Parameters are the
data sent from client to the server side program.
Printing a Stack Trace to the Server Console When you generate an exception in a
program, it will be better to print out the exception stack trace to catch
the error instead of debugging jsp pages.
Nested If
Statement Nested If statement means to use the if
statement inside the other if statement. Here we are providing you an
example using Nested-If statement.
JSP Session Parameter rewrite JSP session provides methods like
getCreationtime(), getLastAccessedTime(),
getId(), invalidate(),getMaxInactiveInterval(),
setMaxInactiveInterval(),
removeAttribute(String name) and setAttribute(String, object)
which will provide the session information.
How JSP
Forwards a request The <jsp:forward> forwards the request
information from one resource to the other, for example, one jsp file to
other. To forward a request from one page to other, following syntax is
required which forwards the request to other page.
Getting a Property value in jsp To reduce the the scriplet code with jsp,
there is an easier way of accessing properties of bean by using getProperty
tag which automatically sends the result of the method.
Error testing
in JSP In JSP, you can specify the error page to
be invoked when any error or exception is encountered. Exception and error
can be handled by using two page directives <%@ page
errorPage="errorPage.jsp" %> and <%@ page isErrorPage="true" %>.
Multiple form in
Jsp In this section, we have developed an
Multiple form application . We created two file userform.jsp and
UserForm.java.
Simple Bank Application in
JSP In this section, we have developed a
simple bank application in jsp . In this application user can Update the
User Profile, Cash Transaction, check the account Deposit/Withdraw Cash
details and display transaction report for particular time period.
Date
Formatter in JSP To display the date in different formats, we have used
DateFormat class. This class provides methods like getDateInstance(),
getTimeInstance() and getDateTimeInstance().
Get Column names using Metadata in jsp Here we are providing you an example that retrieves all column
names from a database table student1. Create a table student1 which contains
student_id, student_name and student_address.
Passing
Parameters in jsp JSP can access the HTTP request object. It provides
getParameter() method for retrieving parameter values by name.
Parameters can be passed by using a tag
<jsp:param>.
Insert data in Excel
File from Database using JSP
In this section, we have developed a application to insert data in excel
file from database in JSP. We created file SearchUser.jsp,
excelData.jsp.
Bar Chart
To draw a bar chart, we have used html
tags. In this, firstly create rows with <tr> tag. The tag<td> contains the
row data,<div> tag provides the division in a chart.
Draw
Statistical chart in jsp To draw a bar chart, we have used
JFreeChartLibrary. JFreeChart is a chart library used to
generate different variety of charts. Download jar file: jfreechart.jar and
jcommon.jar
How to
Create JSP Page In this section we will show you how you can create JSP page and then
test on tomcat server. Creating a new JSP page is very simple and any text
editor can be used.
How to Open
JSP? In this section you learn How to Open JSP in text editor. The
JSP file is simple text file with HTML code embedded with Java Code. Since
JSP is simple text file you can simply open it in notepad.
Java bean example in JSP In this Tutorial we want to describe you a code that help in
understanding Java bean example in JSP.This code illustrates the procedure
of handling session and print a Hello world using Java Bean.
JSP
bean get property The code illustrate an example from JSP bean get property. In
this example we define a package bean include a class Employees. Inside the
class we declared a String variable first Name, last Name and address.
JSP
bean set property In this Tutorial we want to describe you a code that help in
describing an example from JSP bean set property. The code include a package
bean , we have a class Employees.
Implementing Bean with script let in JSP This application illustrates how to create a bean class and how to
implement it with script let of jsp for inserting the data in mysql table.
JSP Window.
Open JSP Window. Open is used to open a new window in JSP. The
JavaScript function window.open( ) open a new browser window for the
viewer to use.
JSP
Write XML JSP technology is basically used for building HTML pages
with dynamic content but you can use it to generate dynamic content in other
formats as well, including XML.
JSP
User-Agent JSP User-Agent is used to display the user-agent. The page
displayed you the name of the client requested the page and any refferer.
Jsp to
Excel In this section you will learn how to create an excel file
and write data into it using jsp.
JSP
Request.getContextPath( ) JSP Request .get Context Path ( ), the context path is the
portion of the request URL that indicates the context of the request.
JSP for
Each JSP Error Page is used to specify the custom error page
and runtime error occurs with an exception being thrown, the custom error
page helps in handling the error page and display a customized view of the
exception.
JSP
Error 500 JSP Error 500 is to generate error status 500 in jsp. The
Error 500 occurred when the server encounter an internal error that prevent
it from fulfilling the request.
JSP
Enumeration Enumeration, a concept of core java is an object that
implements the Enumeration interface generate a series of elements, one at a
time. Each call to the nextElement method ( ) will return the
successive elements of the series.
JSP
decode URL JSP decode URL is the process of converting all Hex
Characters back their normal form. . The Tutorial shows you an example to
decode the specific URL.
JSP
Current Path JSP Current Path is used to get the current path of the
JSP page.
JSP Create Variable JSP Create Variable is used to create a variable in jsp.
The scriptlets include a java code to be written as <%! %> provided by the
jsp.
JSP Choose In the given example, the c:if tag is used for a
decision need, to be made in the page. If the result of processing the test
using the EL Expression pageContext.request.method=='POST'
is true, the body of the tag is processed otherwise it is skipped.
JSP
CheckBox JSP CheckBox is used to create a CheckBox in JSP. The JSP
Page allows the user to select more than one option from multiple checkbox
and also print the userdefined message that specify the languages option
choosen by the user on submitting the button.
JSP Buffered Reader JSP Buffered Reader allows the user to read text from
character input stream, that provides the efficient reading of character,
arrays and lines.
JSP Background Image The Section of this tutorial helps you to create JSP
Background Image on your login page .
JSP
Back Button Jsp Back Button enables the user back to the page from
which they just come from.
JSP
Array Length JSP Array Length is performed when you want to compute the
length of array in JSP.
JSP Array Array is defined as the set of similar type of data in
series. The Array can be String, int or character kind of datatypes. The
below example gives you a demo on use of Array in JSP.
JSP Alert JSP Alert is used to put the validation on login page
for the users. The example in this Tutorial provides you to create the
validation on the login form using Javascript method in JSP page.
JSP Absolute Path This section demonstrates you to get the absolute path
in jsp. The absolute path is the full path that contains the root directory
instead of a few directories contained within the absolute path.
JSP Variable in Javascript JSP Variable in Javascript helps you to pass jsp variable
to javascript. The JavaScript include a function that takes the defined
variable from the jsp expression and display the message from variable using
alert box.
JSP SQL
Tag JSP Variable in Javascript helps you to pass jsp variable
to javascript. The JavaScript include a function that takes the defined
variable from the jsp expression and display the message from variable using
alert box.
JSP
Request URI JSP Request URI is used to return the URI of the current
page in jsp. The method request.getRequestURI( ) return you the
request object that will return the URI of the current JSP page.
JSP
redirects In this section, you will learn how to redirect a page in
JSP. You can see in the given example that we have used the method
response.sendRedirect() through which the server sends the response to
the client browser, from where the next request comes and it displays that
url correctly.
JSP Buffer Overflow JSP Buffer Overflow is said to be overflow when the
attribute 'autoFlush' of buffer is set to false. As you know that anything
generated by the JSP page is stored in a buffer.
JSP Value to JavaScript JSP Value to JavaScript tells you to pass the value from
JSP to JavaScript. The JavaScript create a function that accepts the value
from the jsp page.
JSP
URL Encoding JSP URL Encoding is used to encode the url in JSP. URL
Encoding is the process of converting string into valid URL format. The
valid URL format means that the URL contains alpha, digit, extra, escape
characters.
JSP
Thread Safe JSP Thread Safe is used to send only one client request
for processing. It is used to implement Single Thread Model interface.
JSP
System.getProperty JSP System.getProperty is performed when you want to view
the system properties and display them on the browser.
Jsp
Option Value In this section, we are going to create a select box by
retrieving the value from the database in jsp. For further processing, first
of all you need to create a table in the database.
JSP
Open File JSP Open File is used to create a file and write a text
into the file.
JSP
Modulus JSP Modulus is used to determine the modulus of number in
jsp. Modulus is the remainder of division operation.
JSP
Mime Type JSP Mime Type for Multipurpose Internet Mail Extension.
MIME is a describe technique for attaching files to Internet mail by
changing the raw binary files to printable ASCII.
JSP
Meta refresh In this section, you will learn how to use a META
tag in the jsp. The
META
tag with an HTTP-EQUIV attribute controls the action of browsers, by
setting the HTTP headers.
JSP
Locale JSP Locale is used to get the preferred locale of the
user. A user can configure their browser with a US language locale ("en_US")
as the preferred one.
JSP
List Size JSP List Size is used to get the size of the list. The JSP
List Size uses array list object to add the elements and finally return the
number of elements are added to the list.
JSP JSTL c:when tag In this section, you will learn how to use the jstl when
tag in jsp. Basically, the choose, when, and otherwise tags can be used to
construct an if statement.
JSP JSTL c:if tag The c:if tag is used for a decision need, to be
made in the page. If the result of processing the test using the EL
Expression pageContext.request.method=='POST'
is true, the body of the tag is processed otherwise it is skipped.
JSP Include Param JSP Include Param is used to pass parameter in the include
directive. The example uses <jsp:param> clause to pass the parameter
name and value to the dynamic jsp page.
JSP
Include jsp This section illustrates you about the <jsp:include>
directive in jsp. With the <jsp:include> directive, you can include
either a static or dynamic file in a JSP file.
JSP
Include File JSP Include File is used to insert a html file and the
text file in the jsp page when the JSP page is compiled. The insert file can
be an HTML file, a text file or code file written in the Java programming
language.
JSP Get
URL JSP Get URL is used to get the url of the current JSP
page. The HttpServletRequest interface has a method getRequestURL ( )
that return the url of the current page.
JSP get Parameter JSP get Parameter is used to return the value of a request
parameter passed as query string and posted data which is encoded in the
body of request.
JSP
Frameset The frameset element holds two or more frame elements.
Each frame element in itself holds a separate document.
File Upload Examples In JSP
This tutorial is very helpful in the developing the
project in which you have to upload any type of files whether single or
multiple simultaneously.
JSP And Excel
This tutorial helps you for performing several operations on the Excel Sheet
by using JSP. This section also introduces about a 3rd party APIs provided
by Jakarta-Apache Group that is POI.
JSP Search Book Example
Learn how to create database driven application in JSP. In this example we
are connecting to MySQL database to perform search.
Ask Questions? Discuss: JSP Tutorials - Page 3
Post your Comment