Showing posts with label frameset. Show all posts
Showing posts with label frameset. Show all posts

Wednesday, 15 February 2017

Handling Sessions in Servlets web technologies jntuh

 A web application takes a name as input and on submit it show a hello<name> page where <name> is taken from the request, it shows the start time and  a logout button on clicking this button it should show a logout page with thank you<name> and duration of usage(use session).


To implement the above program in servlets following folder structure is to be followed:

In the src folder all the required files for our application should be kept.

Below snapshots shows u detail of all the programs
home.html

index.html

op.html
res.html

FirstServlet.java


logout.java

After Compilation of your servlets keep the .class files in classes folder as shown below


Following are the images and css files:







The WEB-INF folder structure is as follows



The output of servlet is as follows:










Sunday, 12 February 2017

wt calculator program using servlets

CALCULATOR PROGRAM
AIM: To implement calculator operations using servlets and access the results stored in database

The below image shows the directory structure to be followed in tomcat server




After compiling java programs place class files in classes folder


To use database we require mysqlconnector.jar file which should be placed in lib folder.


Below is the deployment descriptor which gives the details about servlet,servlet class,url-pattern 



All the source code file are kept in src folder.


This is the main page where we are creating frames and accessing servlets in it.


The File which gives the details about left frame.

Calculator html file.Notice the target attribute here.

The file for another frame where results are showed.

This is the calculator servlet.


Calculator HTML file.

Calculator results page.


Calculator db servlet.



Tomcat Manager page.U can see the deployed calc project.


Calculator index page running on tomcat server.




Calculator table in Database.