Answered You can hire a professional tutor to get the answer.

QUESTION

CIST 2373 - Java IIILab #2 - 40 Points Spring Semester, 2019 [Simple Servlets] Part I - Build a simple Servlet called MyServlet using NetBeans. Add...

CIST 2373 - Java IIILab #2 - 40 Points

Spring Semester, 2019

 [Simple Servlets]

Part I - Build a simple Servlet called MyServlet using NetBeans. Add this Servlet to you "ChattBank" Project. This MyServlet will display a message like "Go Braves" in a simple <h1> tag. Run this servlet from a Browser window by typing in the servlet name in the URL line.

(ie. http://localhost:8080/ChattBank/MyServlet). Make sure that your Server is up and running before you test this Servlet. The best way to do this is just Run your "ChattBank" Project once before you test the Servlet. Running the Project will start the Server.

Part II - Next, build a simple Servlet called LoginServlet in your "ChattBank" Project. Now make it so that when the Customer logs in, the LoginServlet will get called and will validate the user id and password. 

1.) At first, just make sure that the Servlet gets called correctly. So just print a simple message like "LoginServlet Running...". 

2.) Remember, to call the LoginServlet, you will need to modify the FORM tag in the "Login.html" file:

<form action="http://localhost:8080/ChattBank/LoginServlet"     method="post">

3.) Test it out. When you click the Login Button on the LoginForm, you should see "LoginServlet Running...."

Part III - Now, modify the LoginServlet. 

1.) Make it so that when the Servlet gets called, it reads the id and password from the Login Form. 

Use :   request.getParameter() to get these items. At first just read in these 2 strings and display them to the Server Log.

2.) If the id = "admin" and the Password = "123", return an HTML page    that says "Valid Login".

3.) If not return an HTML page that says "InValid Login". Use out.println() to send these HTML messages. 

    4.) Test out your WebApp.            

Part IV- Lastly, modify the LoginServlet. This time we are going to go to the database to verify the user login. First look at the ChattBank database. There is a Customers table. In this table there is a UserID and a Passwd. Write the database code, in your LoginServlet to let anyone of these customers login, using their own ids and passwords.    

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question