Friday, July 15, 2016

Tutorial on Serialization in Java - Part3

How to customize Serialization:

Anyhow, Java handles serialization process then what’s the need of customizing it. Let’s look at a small scenario.

Let’s consider our TestObject class has a transient field so that it cannot get serialized and imagine we do not have the source code for this class and we have a requirement that we need to get this field serialized which has defined as transient in the source code like below.

Friday, June 17, 2016

Tutorial on Serialization in Java - Part2

Transient keyword:

When we have a class which implements Serializable interface, that means its eligible for getting serialized but we want few fields not to get serialized then we can place the transient keyword before their declarations to tell the serialization mechanism that the field should not be saved along with the rest of that object's state. Then those transient fields will not be serialized. That means their values will not be saved into bytestream while serialization and when deserialization, those transient fields will be stored back into the object with their default values.

For example, 

Tutorial on Serialization in Java - Part1

What is serialization and how its performed?

Serialization is a mechanism through which we can save the state of an object by converting the object into a byte stream.

Serialized object (byte stream) can be transferred over network, persisted or saved into file/database.
We can deserialize the Serialized object (byte stream) and gets back the original object.

Let’s try to write a Java' program to serialize an object.

Wednesday, September 25, 2013

Creating a Simple Login Form using JSPs and Servlets in Eclipse - Part 4

Hi Guys,

Lets try to create two jsp pages now, one is "LoginSuccess.jsp" which we redirect to, when the given input credentials are valid and other one is "LoginFailure.jsp" which we redirect to, when the given input credentials are not valid.

Friday, September 20, 2013

Creating a Simple Login Form using JSPs and Servlets in Eclipse - Part 3

Hi Guys,

    In Part 2, we came to know that how to create LoginServlet.java to let the LoginForm.jsp works which we created in Part 1, but left with the database setup process that we are going to see now.
    As we said, we use MySQL database for this login application development. MySQL is the most used open source RDBMS for its speed, ease of use, portability, small size, performance and rich features.

Wednesday, September 18, 2013

Creating a Simple Login Form using JSPs and Servlets in Eclipse - Part 2

Hi Guys,

In 'Part 1', we saw how to create a simple login jsp(LoginForm.jsp) page. Now, let this jsp page works for us.

Note: If you didn't go through the 'Part 1', you can go through it here.

    If  we enter the UserId and Password values in the 'LoginForm.jsp' which we created in Part 1 and when clicked on 'submit' then we get the following error page.


Wednesday, September 11, 2013

Creating a Simple Login Form using JSPs and Servlets in Eclipse - Part 1

Hi Guys,

Here, we are going to create a simple login form using jsps and servlets in eclipse.

Lets have a little introduction about these technical terms. 

JSP: Java Server Pages (JSP) is a technology to create dynamically generated web pages based on HTML, XML, or other document types.

Servlet: Servlets, are server side java programs. Servlets are mainly used as a controller to process or store data that was submitted from an HTML form and to provide dynamic content such as the results of a database query. They can be thought as Java Applets that run on servers.

Eclipse: It is an Integrated development environment (IDE) used to develop applications in Java and, by means of various plug-ins, other programming languages also and it is an open source. Here, we use this IDE to develop our login example source code.