JSP ASSIGNMENT TO CREATE A web application------- Library catalog-- Create a web
ID: 3824724 • Letter: J
Question
JSP ASSIGNMENT TO CREATE A web application-------
Library catalog--
Create a web application using JSP, MySQL, and the regular front-end technology stack (HTML,
CSS, JavaScript) to allow patrons to interact with your local library’s catalog online. Your application
can include client-side JavaScript to make the interface more user-friendly, but it should always
perform the necessary server-side validations to protect the integrity of the library’s catalog and
inventory.
REQUIRED FILES ARE FOUND AT : https://onedrive.live.com/?authkey=%21AE9fhY5Qj7AoncA&id=B4FD0EF12F8755C1%21105&cid=B4FD0EF12F8755C1
Requirements:
The librarian has given you the following requirements:
• The web application should include a log in and sign up page.
o Log in page should use a username and password.
o Sign up page should require the following fields: first name, last name, username,
password, and password confirmation.
o There should be a JSP session running to keep track of whether the user is logged in
or not.
• Any user can browse the catalog, regardless of whether they’ve signed up or logged in. In
other words, there should be no session check on the page that allows browsing of the catalog.
o The user should be able to select from a list of topics that filters the books visible on
the browsing screen. Filtering by a different topic than the one currently selected
should fire off a query to the server - filtering should not be happening in the browser
/ JavaScript.
o If no topic is selected, the page should show all books.
o The following information should be shown at a minimum: Book title, book author,
whether it’s available for checkout, and a way to reserve a copy.
• When they are logged in, users should be able to reserve a copy of their favorite available
books from the browse catalog page. If not logged in, the user should still see the button to
reserve the copy which will take them to the log in page upon click.
• There should be a page which allows logged in users to show their list of reserved books. If
not logged in, trying to navigate to this page (even via a direct URL) should require the user to
log in first.
Database structure
There is one SQL file attached with the assignment to create the database ‘library_catalog’
Explanation / Answer
web.xml
<web-app>
<context-param>
<param-name>driver</param-name>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
</context-param>
<context-param>
<param-name>url</param-name>
<param-value>jdbc:oracle:thin:@localhost:1521:XE</param-value>
</context-param>
<servlet>
<servlet-name>select</servlet-name>
<jsp-file>/ListStudent.jsp</jsp-file>
<init-param>
<param-name>usn</param-name>
<param-value>nareshit</param-value>
</init-param>
<init-param>
<param-name>pwd</param-name>
<param-value>hari</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>select</servlet-name>
<url-pattern>/ListStudent.jsp</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>QueryStudentInfo.html</welcome-file>
</welcome-file-list>
package ourbean;
public class Greeter
{
private String name;
public String greetme(String s)
{
return "we welcome..."+name;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
System.out.println("name:"+ name);
return name;
}
}
package ourbean;
public class UserAuth
{
private String username;
private String password;
public void setUsername(String username)
{
this.username = username;
}
public String getUsername()
{
return username;
}
public void setPassword(String password)
{
this.password = password;
}
public String getPassword()
{
return password;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.