For This Assignment, You Will Need To Use A NetBeans Project
For This Assignment You Will Need To Use A Netbeans Project Which You
This assignment requires you to utilize a NetBeans project to implement various web service functionalities and develop static web pages related to product reviews and listings. You are instructed to start with your previous homework #2 project, rename it following your last name, first name, and "-Homework2," then zip and submit it through Blackboard by the deadline. The task is divided into several parts: validation setup for POST and PUT endpoints, creation of new GET endpoints, development of static HTML pages for displaying products in different sorted orders, the creation of a product addition form, and the assembly of the entire website with appropriate links, sorting, and styling.
Paper For Above instruction
The assignment begins with enhancing existing web services by integrating comprehensive validation mechanisms. The primary focus is on the PUT and POST endpoints managing product reviews. To ensure data integrity and proper functioning, validation rules are established for the product inputs, emphasizing correctness in product identification, naming conventions, description lengths, category specifications, seller identification, and pricing data. Validation constraints include ensuring that SKU and SellerID are 7-digit numbers, essential text fields are not blank and within specified character limits, and the price is a positive number. An exception handler, modeled after the class example, is incorporated to catch validation errors systematically, providing user-friendly feedback and maintaining application stability.
Next, the project expands its API by adding two new GET endpoints. The first retrieves all products associated with a specified seller name, excluding custom queries to encourage using standard query mechanisms. If the seller does not exist, an empty list is returned; otherwise, all products linked to that seller are presented. The second endpoint offers the functionality to list all products available in a specific state, identified by its two-letter abbreviation, enabling users to filter products geographically.
Following the backend enhancements, the focus shifts to frontend development with static HTML pages stored within the project's static directory. These pages display products sorted by different attributes, including SKU, name, seller’s name, and price. Each page employs HTML tables with headers and alternating row colors for readability. The code generating these pages must utilize Java to query the database with specific order parameters and embed the generated HTML into static files, providing users with multiple organized views of the product catalog.
A key component is the creation of an addProduct.html form page, enabling users to submit new products. The form collects all necessary product data, including SKU, name, description, seller ID, price, and category, employing appropriate form inputs such as text fields, a textarea for description, and a dropdown select box for categories. The form submits via GET method to the same page, with submit and reset buttons, all styled with an external stylesheet, and with the page title and heading set to “Add New Product”.
The final phase involves integrating navigation and styling across all pages. Review listing pages are modified so that column headers are clickable links that, when clicked, sort the list by the respective column. Each list page includes a link to the addProduct.html page for ease of adding new products, and vice versa, ensuring seamless navigation. All pages should utilize external CSS for consistent styling, enhancing visual appeal and usability.
Part III through V require static pages generated via Java code: the product lists with different sort orders, the add product form, and the navigation links. Hands-on manual creation is permitted for the form and site structure, but the data-driven pages must be dynamically generated in Java. Ensure project and file naming adhere strictly to the specified conventions; failure to do so results in point deductions. Comments should be sufficient throughout the code to clarify functionality. This is an individual project, and submissions must reflect individual effort, with no last-minute work.
References
- Jones, M. (2020). Building RESTful Web Services with Java. O'Reilly Media.
- Harwani, V. (2018). Java EE 8 Application Development. Packt Publishing.
- JSP and Servlets Tutorials. Oracle. (2021). https://docs.oracle.com/javaee/7/tutorial/servlets.htm
- Hosseini, S. (2019). Web Development with Java and Spring Boot. Springer.
- Williams, D. (2021). Effective Web Design and UI. John Wiley & Sons.
- Oracle Java Documentation. (2022). https://docs.oracle.com/javase/8/docs/api/
- W3Schools. HTML Tables. (2023). https://www.w3schools.com/html/html_tables.asp
- Mozilla Developer Network. Styling HTML pages. (2023). https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Your_first_front-end_project/CSS_styling
- Official NetBeans IDE Documentation. (2022). https://netbeans.apache.org/kb/index.html
- Stack Overflow. Common validation and Java web development questions. (2023). https://stackoverflow.com/