Design and Implementation of a Gas Purchase‑Sale‑Stock System Using Maven, Spring, and ExtJS

This article walks through the complete backend development of a gas purchase‑sale‑stock management system, covering entity and database design, Maven multi‑module project setup, Spring and web.xml configuration, environment‑specific property handling with a portable‑config Maven plugin, and a sample login controller implementation using Java, Spring MVC, and ExtJS.

Java Captain
Java Captain
Java Captain
Design and Implementation of a Gas Purchase‑Sale‑Stock System Using Maven, Spring, and ExtJS

The guide begins by defining the system’s functional modules (system, base, purchase, sale, stock) and creating a corresponding entity list, followed by a physical database model designed in PowerDesigner and implemented in a MySQL database named gpss.

Next, a Maven multi‑module project lyyzoo-gpss is created with two sub‑modules: lyyzoo-gpss-base (containing DAO, entity, and service layers) and lyyzoo-gpss-web (holding controllers, JSPs, and static resources). The parent pom.xml defines the project structure and includes the portable-config-maven-plugin to replace configuration values during packaging.

Key configuration files are set up: web.xml defines context parameters, listeners, filters, the Spring MVC servlet, and error pages. config.properties stores JDBC and Hibernate settings for the development environment.

Environment‑specific XML files ( config-dev.xml and config-online.xml) contain <replace key="...">... entries that the Maven plugin uses to generate the final property file for each build profile.

The Maven profiles section in the parent pom.xml defines dev and online profiles, each setting the env property that selects the appropriate configuration file during the mvn clean package -Denv=online build.

Static resources are organized under src/main/webapp/static with subfolders for libraries, CSS, JavaScript, and images. JSP layout files ( taglib.jsp, meta.jsp, extjs-neptune.jsp) centralize tag imports, meta information, and library references, exposing context paths via JSTL variables ( CTX, STATIC_CTX_URL, LIB, etc.).

A base controller class provides easy access to the HTTP session and the currently logged‑in User. The HomeController implements login, logout, and error handling, using a VCodeGenerator to produce CAPTCHA images and Cryptos.encryptMd5 for password hashing. Successful authentication stores a sanitized User object (password set to null) in the session.

Finally, the article outlines testing and deployment steps, including local functional testing, error handling verification, and deployment to a cloud platform using the environment‑specific WAR produced by the Maven build.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavadatabasespringmavenWeb DevelopmentExtJS
Java Captain
Written by

Java Captain

Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.