Sie sind auf Seite 1von 3

JSP - Exercise

#1 Program
Create a JSP form that accept the below field along with the Submit button, Using the Servlet program
print the selected value in another JSP inside the highlighted html object.
Employee ID Textbox Should be a number Textbox
Employee name Textbox Textbox
Employee Qualification Checkbox Add upto 10 qualification Selectbox
Known languages Multi select box Add upto 5 languages Checkbox

#2 Program
Table name: java_employees

Table structure:

Connection details
JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver"
DB_URL = "jdbc:oracle:thin:@192.168.1.12:1521:edukdev"
USER_NAME = "HOT_ACADEMY" ; PASSWORD = "ha11marks"

Create a JSP form that has a dropdown which contains the below value.

Values in the dropdown


Add new employee
Edit employee detail
View employee detail
Display all the employees in the employee table

On changing the dropdown using A Servlet program process the action based on the selected value. Use
3 JSP for the whole action.
1. JSP-1 for the above dropdown
2. JSP-2 for add and edit
3. JSP-3 for view employee and view all employees

For edit and view you need to read employee_id in JSP-2. Validate number if the field required number
data. NOTE: Write a proper JSP comment against each logic
EMPLOYEE_ID NUMBER(6),
FIRST_NAME VARCHAR2(20 BYTE),
LAST_NAME VARCHAR2(25 BYTE) NOT NULL,
EMAIL VARCHAR2(25 BYTE) NOT NULL,
PHONE_NUMBER VARCHAR2(20 BYTE),
JOB_ID VARCHAR2(10 BYTE) NOT NULL,
SALARY NUMBER(8,2),
COMMISSION_PCT NUMBER(2,2),
MANAGER_ID NUMBER(6),
DEPARTMENT_ID NUMBER(4)
JSP - Exercise

Procedure details: JAVA_ACADEMY.GET_EMPLOYEE_INFO_PRC (


p_employee_id IN NUMBER ,
lc_employee_info OUT SYS_REFCURSOR
);

#3 Program
Create a JSP form that accept 2 numbers and a dropdown along with a submit button. Raise the error if
the given value is not number. Raise error if the first number is less than the second number. On clicking
the submit button, Using another JSP file print the result.
Values in dropdown
AE Add even numbers between 2 values
PM Odd number
PD Print the numbers that has remainder value 2 when divided by 3

#4 Program
Create 3 JSP which contains the below details inside the table. JSP-1: Details about Your education
history, along with the label. JSP-2 Details about Your family details along with the label JSP-3 Your
address details along with the label. Give heading for each table and print all the content inside one JSP.

#5 Program
Create 3 JSP files, JSP-1 that accept the Amount, percentage, number of years (Dropdown from 1 to 12
should be populate with help of java) along with submit button and calculate the interest and print the
result in JSP-3

Validate amount and percentage should be a integer or double. On clicking the Submit it has to GO to
JSP-2. (No servlet)

OUTPUT
Amount Year % Interest
xxxx xxx xx xxxx

#6 Program
Create a JSP files, that accept the below value along with a submit button

1. MovieId [textbox]
2. MovieName [textbox]
3. Director [textbox]
4. Movie type (P/N) [Radio]
5. Group_id [dropdown] Group given below need to populate from bean;
6. No of theater released [textbox] only number greater than 5

On clicking on submit button it takes to a Servlet and it redirect to another JSP where you need to get the
below data for N number times based on the value given in “No of theater released” along with the
submit button

Theater name
Theater location
Released date
JSP - Exercise

After adding the data on clicking on the submit button it takes to the same Servlet and redirect to another
JSP and print the result in the below format where movie type =”P”

MovieId MovieName Director Movie type Theater name Theater location Released date
Xxx xxx xxx xxxx xxx xxx xxxx
Xxx xxx xxx xxxx xxx xxx xxxx
Xxx xxx xxx xxxx xxx xxx xxxx
--- ---- --- --- --- -- ---

GROUP_ID GROUP_NAME
1000 ACTION_MOVIE
1001 COMEDY_MOVIE
1002 FAMILY_MOVIE
1003 ROMANCE
1004 CHILDREN
1005 HORROR
1006 DOCUMENTARY
1007 SUSPENSE/THRILLER

#7 Program
Create a JSP with a link that takes to the below website in a new tab

1. Yahoo.com
2. Google.com
3. Whatuni.com
4. Facebook.com
5. Hotcourses.com
6. Lovemycourse.com

#8 Program
Create 4 JSP files, JSP-1 that accept the two numbers and the below radio button

Add all numbers between numbers


Add reverse of all numbers between 2
Add perfect numbers between this 2

Raise the error if the given value is not number. Raise error if the first number is greater than the second
number. On clicking the submit button, print the result in JSP-4.

NOTE: On clicking the Submit it has to GO to JSP-2 which internally call JSP-3 and JSP-4 (No servlet)

Das könnte Ihnen auch gefallen