Code Snippets


Report Generation

This is an example of a full working JSP application using JSP and Servlet. Generating reports of data in the web page is a requirement facing by developers very often. The purpose of this example is to demonstrate how to make reports (excel and pdf) on data from a JSP page (which may be coming from underlying database in most cases). view code snippet

 

ImplementCookies

This program demonstrates how to create a simple login form which stores username and password in the browser even after the web page is closed. Users are provided with the option to decide whether to remember their username and password using a check box. view code snippet

 

Upload File

This program demonstrates how to upload a file from client machine to server using JSP and servlets. The program can be modified according to your needs. For example checking the file type or file size can easily be added with this. view code snippet

 

Login panel

This program illustrates authentication of a login page, using values from database. An error message will be displayed if the login attempt is a failure. If the login attempt is a success a success message will be displayed and the username is set as a session variable. view code snippet

 

Database Access

This example executes any query entered by user from the front end. If user is entering a select query result will be displayed as a list. Update and delete queries will be performed and give the success or failure message. The program is implemented using jsp:usebean with database connections and query execution performed in jsp beans. view code snippet

 

Resource File

This example demonstrates the usage of "resource.properties" files in JSP. that is, how to store string constants or error messages in a resource.properties file and how to display it in the JSP page. view code snippet

 

File Operations

Manipulating files are daily requirements of developers. Here you can find some useful applications implementing file operations, mainly reading a file , writing to a file, streaming file etc. view code snippet

 

Java Functions

Here some basic java functions are explained like array sorting, date functions, string tokenizing, file printing etc. view code snippet

 
back to bobcares.com