0% found this document useful (0 votes)
11 views2 pages

LAB1

Uploaded by

danglhse170518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

LAB1

Uploaded by

danglhse170518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

LAB 1

Exercise 1:
Create a Project using JSP/Servlet to create a web page to enter personal information such as:
IDStudent, Fullname, Gender (Male or Female use option button). After submitting, that
information will be displayed on the screen. According to you the difference of creating forms
when using JSP/Servlet?

Exercise 2:
JSP Scripting Elements

1. Do the following with only JSPs (and no servlets) and using JSP scripting
elements
1. Create a method that take two int numbers and return their sum as int.
2. Invoke the method from within template text using JSP elements (example
o/p - Sum of 3 and 4 is 7.)
3. Print above line to console as well using JSP elements.
2. Deploy the project into tomcat, restart server and compare the source jsp with the
generated servlet.

Exercise 3:
JSP Forms and Standard Actions

1. Create a JSP web form to submit the name and age of an employee.
1. Form should be submitted to a JSP file.
2. Create a bean class called Employee for storing the name and age of the employee
3. Within the JSP to which form is submitted, do the following using only standard
actions
1. Declare an instance of the Employee JavaBean
2. Populate the Employee object with values from form submission
3. Retrieve the values and display it with proper template text:
1. Employee name is John
2. Employee age is 30

Exercise 4:
1. JSP and web.xml
1. Create two simple JSP files.
1. A JSP web form that will submit data to the second JSP
2. Second JSP may simply print the values of the form submission
2. Create an entry in the web.xml for first jsp file alone
1. Declare load-on-startup element with a positive value
2. Define a url pattern
3. Package the application as a war
4. Deploy the war into tomcat and start the server
5. Check tomcat jsp generation folder for class files generated
6. Run a url with the url pattern defined
7. Check tomcat jsp generation folder again for class files generated
8. List down the classes generated before running the url and after running the url
and explain the reason.

You might also like