You are on page 1of 4

EX NO-6a

DATE:

SIMPLE SERVLET

AIM:
To write a html and servlet to demonstrate invoking a servlet from html.
ALGORITHM:
1. Create one root directory
2. Now create another folder web-inf in the root directory, this web-inf folder contains
web.xml file
3. Create classes folder with in web-inf folder
4. Compile our servlet program which is in src folder, so we will get one .class file right, just
copy this .class file into classes folder in web-inf folder
5. By the way, we are going to run our servlet by using Tomcat server. So we must set the
class path for Tomcat related jar file, servlet-api.jar
6. You can find this jar file in your Tomcat 1.0\lib.
7. Open the command prompt and type C:Program Files\Apache Software foundation\tomcat
7.0\web-apps\root\web inf\classes.
8. Compile the file using the path C:\Program Files\Apache Software Foundation\Tomcat
7.0\lib\servlet-api.jar
9. Run the file in IE
Ex.No:6(b)
Date:

SERVLET WITH HTML

AIM:
To write a Html program for invoking servlet with html.
ALGORITHM:
1. Start the program.
2. Client:
a)In the MyServlet Class on the client side,declare the contents that you like to transfer
to the server using html form and input type tags.
b)Create a Submit button and close all the included tags.
3. Server:
a)In the sevelet side using the parameter request get the string declared in the client.
b)Include the neccesary html coding that helps to displays the content
4. stop the program

Ex no:7(A)
Date:

SIMPLE DATABASE CONNECTION USING JSP

AIM:
To write a program using JSP with database connection.
ALGORITHM:
1.Create a html file with form tag.
2.The form tag action=http:\\localhost:8080\login.
3.Create two text boxes user id,first name,last name and password and button submit.
4.Import the neccessary packages.
5.Declare the connection,statement and result set object.
6.Check the database connection in the jsp file.
7.The data are inserted into the corresponding table.
EX NO:7 b)
DATE:
PROGRAMS USING THREE-TIERS APPLICATIONS USING JSP
AIM:
To write java servlet programs to conduct online examination and to display student
mark list available in a database.
ALGORITHM:
Start the program
Client:
o In index.html on the client side declare the contents that you like to transfer to the
server using html form and input type tags.
o create a submit button and close all the included tags.
Servlet:
o Import all necessary packages
o Define a class that extends servlet
o In the doPost() method, do the following:

Set the content type of the response to "text/html"

Create a writer to the response

Get a paratmeter from the request

If its value is equal to right answer then add 5 to mark variable

Similarly repeat step for all parameters

Display the result in an html format using the writer

End the program.

Ex.No:8a

XML- DOM PARSING

Date:

AIM:
To write a program for implementing bank information in xml document using DOM.
ALGORITHM:
i) Start the program
ii) In java program, import all necessary packages and declare the class DOMExampleJava.
iii) Then create a file object for the Stocks.xml file
iv) In XML program, create the bank information
v)
Display the bank information using the java file.
v) Stop the program
EX NO:8 b)
DATE:

PROGRAM USING XML-XSLT

AIM
To implement XSLT in XML document.
ALGORITHM:
1. Start the program
2. Create an XML document with the details of the student such as name, address, standard
and mark.
3. Import an XSL file to the xml file.
4. The XSL file imported puts the details of the students given in the xml file in a table and
gets the details of each student from the xml file using the value-of attribute.

5. The output in the browser would be the details from the XML file with the style
specified in XSL applied to it.
Stop the program.
Ex NO:9 PROGRAM USING AJAX
AIM:
To write programs to search and display chemistry elements definition detail
using JSP.
ALGORITHM:
Start the Program
Enter the chemistry element in index.html
Read the element data by request.getParameter() on chems.jsp.
Check given element in element list.
Display the definition of given element.
Stop the Program

You might also like