Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. SUMMARY a. You will have two jsp pages, one that submits user entries to the other. You will also have a regular Java class

1. SUMMARY

a.

You will have two jsp pages, one that submits user entries to the other. You will also have a regular

Java class that provides methods for the second JSP page to access.

b. This lab will involve the following new features:

i. Incorporating external Java classes into a web app.

ii. Handling submitted Request values in a separate JSP page.

2. DETAILS

Alrighty... More web app Development!

This week, were going to expand our HTML a bit, and were going to expand our Java out to two pages. Were

also going to make a class and use it in our web pages.

Youll learn how to:

1. Import and use external classes in JSP pages and Tomcat.

2. Submit form data from one JSP page to another.

3. Perform basic formatting of HTML pages using tables.

So were going to make a simple Movie Fan registration site. This is what were going to make:

1. A home registration page.

a.

This page will have first/last name fields to fill out along with favorite movie and actor.

b. This information will be in an HTML form, as you did last week; but this time the form will be

submitting the information to our registration confirmation page.

2. A registration confirmation page.

a.

This page will instantiate a class you will create called FavoritesManager, and call methods on

that class that will compare the users submitted favorites against yours (which youll put into

the class when you code it).

3. A new java class.

a.

This class will have two methods that will check the users favorites against yours.

i. checkFavoriteMovie.

ii. checkFavoriteActor.

b. This class/object is being used by another object (in this case, our compiled JSP page that

becomes a servlet, which is a standard java class/object), so for that reason, we dont have

any beginning method such as init or main.

These are the

three files

youll be turning in.

So now Im going to take you through the details... follow along carefully.

1. register.jsp

a.

I have put the template for this file where you got this doc from.

b. Put this file in the same place we worked last week:

C:>>Program Files>>Apache Software Foundation>>Tomcat 9.x>>webapps>>ROOT

c.

In this file, youre creating a simple form that asks for first/last names and a movie and actor.

d. Youll notice that this form is different from last weeks. It has an action parameter that is

set. This tells the form which web page to submit the forms contents to once the submit

button is clicked. Were sending all the info to our second jsp page.

e. Youll see Ive put in an HTML table. Tables help format spacing/layout on an HTML page.

There are many ways to do this these days (DIVs w/ CSS, etc.), but I want to keep this as

simple as possible.

f.

A quick explanation of tables as we discussed in class:

i.

tag encompasses a whole table, which is just rows and cells like in a

spreadsheet.

ii.

is a row tag. This starts a new row.

iii.

tags, not in nor
is a cell tag. There is supposed to be the same amount of cells in each row,

which is why youll see I spanned the first cell in the first row 100% so that I could

center the title (its similar to merging columns).

iv. Your actual content always goes within the

tags.

1. You can actually nest tables (by starting a new table inside of

), and

this is one way to do more elaborate layouts of content.

g.

Changing colors (***NOT required*** ...just including this for your own fun/interest if youre

not familiar with HTML).

i. Youll see that Ive changed the background color of the cell that contains the title:

ii. ffffcc is the color code part. Heres a color chart link that shows you a bunch of codes.

http://www.visibone.com/color/hexagon_800.gif

iii. Feel free to change the colors of anything. Ive aligned the text of this cell, so if you

were just to change the background color only, the code would look like this:

style=background-color:ffffcc

1. Notice that the text-align:center; has all been removed, so you could add

this color code to other cells if you wanted to play around with the look of it.

h. Now Ive started you off with one line of html that creates a text box (

that Ive created comment lines where you need to add lines for the appropriate input. Be

sure to adjust the name parameter correctly, because this is the lookup value youll be using in

your other jsp page.

1. register.jsp

a.

I have put the template for this file where you got this doc from.

b. Put this file in the same place we worked last week:

C:>>Program Files>>Apache Software Foundation>>Tomcat 9.x>>webapps>>ROOT

c.

In this file, youre creating a simple form that asks for first/last names and a movie and actor.

d. Youll notice that this form is different from last weeks. It has an action parameter that is

set. This tells the form which web page to submit the forms contents to once the submit

button is clicked. Were sending all the info to our second jsp page.

e. Youll see Ive put in an HTML table. Tables help format spacing/layout on an HTML page.

There are many ways to do this these days (DIVs w/ CSS, etc.), but I want to keep this as

simple as possible.

f.

A quick explanation of tables as we discussed in class:

i.

tag encompasses a whole table, which is just rows and cells like in a

spreadsheet.

ii.

is a row tag. This starts a new row.

iii.

tags, not in nor
is a cell tag. There is supposed to be the same amount of cells in each row,

which is why youll see I spanned the first cell in the first row 100% so that I could

center the title (its similar to merging columns).

iv. Your actual content always goes within the

tags.

1. You can actually nest tables (by starting a new table inside of

), and

this is one way to do more elaborate layouts of content.

g.

Changing colors (***NOT required*** ...just including this for your

Register.jsp:

Movie Fan Membership Registration

First Name

Last Name

Favorite Movie

Favorite Actor

This question has 3 parts so I splited 3 questions already.

So another 2 are:

https://www.chegg.com/homework-help/questions-and-answers/main-new-functionality-lab-building-learned-last-lab-1-summary--two-jsp-pages-one-submits--q32617783

https://www.chegg.com/homework-help/questions-and-answers/1-summary--two-jsp-pages-one-submits-user-entries--also-regular-java-class-provides-method-q32617693

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Google Analytics 4 The Data Driven Marketing Revolution

Authors: Galen Poll

2024th Edition

B0CRK92F5F, 979-8873956234

More Books

Students also viewed these Databases questions

Question

=+3. How serious of a response is warranted to this situation?

Answered: 1 week ago