Giter Club home page Giter Club logo

inventorymgrspringmvccrud's Introduction

Summary

An inventory management web-app using Java and the Spring MVC framework with CRUD functionality. Although this web-app implements session control, the database does not persist and reverts back to the original state of pre-loaded inventory when the server is restarted. This project is a Maven configured project built in the Spring Tool Suite w/ SpringMVC dependencies served via Apache Tomcat 8.

This web-app is my first attempt at using SpringMVC. I first wrote JUnit tests but ran into an odd problem where the IDE didn't detect any test cases which I'll attempt to resolve before zipping into .war and deploying to AWS. I then proceeded to fill out methods that resulted in output via Java Server Pages with html/css/bootstrap. I provided the user the ability to manipulate data in many ways but also attempted to engineer limits to prevent misuse of the app. By and large, the web-app is mobile friendly with a toggling hamburger menu and responsive font sizes and bootstrap table, the data table needs a little work to be completely mobile ready, but this would serve as a good template for a mobile warehouse inventory management app.

(Side note: JUnit tests are somewhat working but require a lot of commenting out in substitute for the mockDAO lines)

In This Document

  1. How to Execute
  2. Class Structure Overview

How to Execute

  • The web-app is hosted on my AWS server: here
  • Download the entire program as a .war file here

Instructions

  1. User arrives on landing page.
  2. User menu:
    • View All Products
    • View Details of a Product
    • Edit Product
    • Add New Product
    • Delete Product
  3. Each product manipulation option can also be executed directly from the inventory overview.

Class Structure Overview

  • The ProductIMSController class is the controller and interacts with the ProductDAOImpl class which implements methods declared in the ProductDAO interface. The product and list objects are constructed using information from the Product class and accompanying .csv file pre-loaded with inventory information.
  • The ProductIMSController provides information back through .jsp files for the user to view and manipulate.

Code Examples

example of edit product controller code with form validation logic

	public ModelAndView editByID(@Valid Product product, Errors errors) {
		ModelAndView mv = new ModelAndView();
		if (errors.getErrorCount() != 0 ) {
			mv.setViewName("editProduct");
			return mv;
		} else {
			mv.addObject("inventory", productService.editProduct(product));
			mv.setViewName("viewInventory");
			return mv;			
		}
	}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.