You are on page 1of 2

JAVA PRACS INDEX

Practical 1: Simple Server-Side Programming using Servlets


Q. 1) Write a servlet that accepts single-valued (Name, Mobile No.) as well as multi-valued
(Languages known, Hobbies) parameters like check boxes and multiple selection list boxes from
an HTML document and outputs them to the screen.
Q. 2) Write a servlet program that accepts an integer n from html form calculates and displays
the factorial of n. If the number is negative, it should redirect to a different error page having link
to the html form.
Practical 2: Advance Server-Side Programming using Servlets
Q. 1) Write two servlets in which one servlet will display a form in which data entry can be done
for the fields dept-no, dept-name and location. In the same form place a button called as submit
and on click of that button this record should be posted to the table called as DEPT in the
database. This inserting of record should be done in another servlet. The second servlet should
also display all the previous record entered in the database.
Q. 2) Write a Servlet that accepts a User Name from a HTML form and stores it as a session
variable. Write another Servlet that returns the value of this session variable and displays it.
Practical 3: Simple Server side programming using JSP
Q. 1) Write jsp files that accept a number from the HTML form and
Displays whether its even or odd.
Its factorial.
Multiplication table.
Q. 2) Write a JSP page to accept two numbers (m,n) from the user, onclick of the submit button
display on a new JSP page all prime numbers between m and n. If the number m is not less than
n (m<n), it should redirect to a different error page having link to the JSP form.
Practical 4: Advance Server side programming using JSP
Q. 1) Write a JSP page, which displays three text boxes for user name, password, and email. On
click of the submit button call another JSP page which will enter the values in the database with
the help of PreparedStatement class. Also use jspInit() and jspDestroy() to open and close the
connection.
Q. 2) Create a java bean that gives information about the current time. The bean has getter
properties for time, hour, minute, and second. Write a JSP page that uses the bean and display all
the information.
Q. 3) Write a HTML page to accept a database table name from the user on click of the submit
button display a JSP to connect to a database and display the total number of records followed by
the contents of the database table using the HTML TABLE tag, The column names should be
fetched from the database.
Practical No 5: Developing Simple Enterprise Java Beans
Q. 1) Develop Converter Stateless Session Bean. Write Enterprise application for converting
Indian Rupees currency to Eurodollars currency. Converter consists of an enterprise bean, which
performs the calculations, and a web client (JSP/Servlet) or Application client.
Q. 2) Develop Calculator Stateless Session Bean. Write Enterprise application for adding,
subtracting, multiplying and dividing two numbers. Calculator consists of an enterprise bean,
which performs the calculations, and a web client (JSP/Servlet) or Application client.

Practical No 6: Developing Advance Enterprise Java Beans


Q. 1) Develop CommonDivMul Stateless Session Bean. Write Enterprise application for
calculating the GCD and LCM of two numbers. CommonDivMul consists of an enterprise bean,
which performs the calculations, and a web client (JSP/Servlet) or Application client.
Q. 2) Design a Mobile Bean as a Stateful EJB containing a variable representing modelname and
three functions setModelName, getPrice, getFeatures. setModelName accepts a string
parameter, getPrice & getFeatures dont have any parameter but return types. Design a servlet
that accepts mobile name from HTML page and shows mobile price and features to user by
accessing mobile bean.
Practical No 7: Developing Simple Web services in Java
Q. 1) Create a web service for calculator that gives addition, subtraction, multiplication, division.
Also create an application client, jsp client and servlet client for the same.
Q. 2) Create a web service that gives (i) NSE Index, (ii) BSE Index, (iii) Gold Rate. Also
create a web client for a share trading firm that displays these values on its home page.
Q. 3) Design a web service for college containing 2 functions- 1 st function getCutoff accepts
coursename as parameter and returns last years cutoff for that course as floating point number,
2nd function getFees accepts coursename as parameter and returns this years fee for that course
as floating point number. Design a client to test the above web service.
Practical No 8: Developing Advance Web services in Java
Q. 1) Create a web service for UGC that contains a method which accepts college name as
parameter and returns the NAAC rating. The college names and their ratings are stored in
database. Design a web client to test the above web service.
Q. 2) Design a web service for a channel containing 2 functions 1 st function called
getBreakingNews which accepts date as string parameter and returns special news of that day,
2nd function accepts sunsign name as string parameter and returns predictions as string. Design a
client to test the above web service.

You might also like