Sunday, January 25, 2015

The JSP life cycle

A JSP life cycle can be defined as the entire process from its creation till the destruction which is similar to a servlet life cycle with an additional step which is required to compile a JSP into servlet.

There are several main processe that will be performed in a jsp life cycle

CompilationInitializationExecutionCleanup



These are much similar to the servlet life cycle

Saturday, January 24, 2015

Creating a file upload form using HTML and JSP



Follow the steps below to create a file upload form using a web application that includes HTML and JSP. In this form we must use the POST() method and not the GET() method. The form action attribute should be set to a JSP file that will handle the uploading process.
To upload a single file you should use a single <input .../> tag with attribute type="file". To allow multiple files uploading, include more than one input tags with different values for the name attribute. The browser associates a Browse button with each of them.


Below is the coding for the HTML file

<html>
<head>
<title>File Uploading Form</title>
</head>
<body>
<h3>File Upload by CodeMonkeyy</h3>
Select a file to upload: <br />
<form action="FileUpload" method="post"
                        enctype="multipart/form-data">
<input type="file" name="file" size="50" />
<br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>

Friday, January 23, 2015

Creating a simple snake game using the HTML5 canvas


Here we are using the new canvas feature in HTML5 to create a simple snake game we used to play in our childhood.



First create a canvas in your HTML page

<canvas id="drawCanvas" width="600" height="600"></canvas>


Then we declare some variables we need in our cording

var drawCanvas = $("#drawCanvas")[0];
            var context = drawCanvas.getContext("2d");
            var width = $("#drawCanvas").width();
            var height = $("#drawCanvas").height();

Thursday, January 22, 2015

Creating a simple login form using HTML and JSP with error handling

Here in this tutorial a simple login form is created for the user to enter the username and the password to login into the web application.

This is the HTML part of the web application, here the interface of the application is created using HTML forms. The code and the screen shot is provided below.

HTML


Using HTML5 canvas to create a simple game.

Here  a simple game is made using HTML5 , follow the steps to create the application.
The HTML page is used to create the canvas, the coding for the HTML page is given below


The above screen shot shows the canvas created using HTML


Wednesday, January 21, 2015

Steps to create a simple web application using HTML and JSP (Simple Calculator)



Here a simple calculator is designed using HTML and jsp. The design is made using HTML and the a jsp code is used to perform the calculation

The below screen shot shows the html code which is used to create the interface of the application.

Introduction to JSP



JavaServer Pages — JSP is a Java based technology that is used to develop dynamic web sites. With JSP, web designers and developers can quickly incorporate dynamic elements into web pages using embedded Java and markup tags. These tags provide the HTML designer with a way to access data and business logic stored inside Java objects

The following figure shows the process of the flow of events that occur after a client 
requests for a JSP page