JSP Servlet Helper Classes Reducing Code Redundancy
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional systems for generating and managing purchase orders in electronic commerce environments suffer from code redundancy, leading to inefficiencies, increased complexity, and a higher propensity for errors, which hampers system performance and user operations.
Innovation Solution
The system modularizes HTML pages, associating each page with an electronically based form mapped to a servlet or Java application, utilizing reusable helper class methods to reduce code redundancy and improve efficiency by reusing code portions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If conventional systems generate HTML pages for order management, then ordering functionality is provided, but code redundancy increases leading to reduced system efficiency
Solution Approach 1:
The patent segments the order management system into modular components: HTML templates define page structure, JavaBeans encapsulate business logic and data, and servlets handle request processing. This segmentation eliminates code redundancy by allowing each component to be independently reused across multiple order types and web pages, directly improving system efficiency while reducing overall complexity.
Solution Approach 2:
The patent implements universal JavaBeans that can serve multiple functions across different order types (e.g., purchase orders, sales orders, requisitions). These JavaBeans encapsulate common business logic, validation rules, and data access patterns that are reused throughout the system, eliminating the need to rewrite similar code for each order type and thereby reducing code redundancy while maintaining high productivity.
2Reliability
If multiple webpages are used for ordering process, then complete ordering information can be collected, but code complexity and error propensity increase
Solution Approach 1:
The patent divides the ordering process into distinct web pages, each responsible for collecting specific information (customer details, product selection, shipping information, etc.). Each page is generated using template files that separate structure from content, and JavaBeans that encapsulate validation and processing logic. This segmentation improves reliability by ensuring each page focuses on specific data collection while reducing code complexity through reusable components.
Solution Approach 2:
The patent introduces servlets as intermediary components that mediate between user interactions on web pages and the underlying business logic. Servlets process form submissions, validate input data, invoke appropriate JavaBeans, and generate responses or forward requests. This intermediary layer improves ordering accuracy by centralizing validation and processing logic, while reducing overall code complexity by preventing direct coupling between web pages and business logic.
3Productivity
If code redundancy is present in ordering system, then implementation is simpler, but system performance and speed are reduced
Solution Approach 1:
The patent segments the system into reusable JavaBeans that encapsulate common ordering logic, validation rules, and data access patterns. These JavaBeans can be instantiated and reused across multiple servlets and web pages, eliminating code redundancy and improving system speed through efficient object reuse. The modular structure maintains implementation simplicity by providing clear, organized components with well-defined interfaces.
Solution Approach 2:
The patent uses configurable parameters and properties within JavaBeans to adapt behavior without changing code. Business rules, validation criteria, and data access patterns can be modified by changing parameters or configuration files rather than rewriting code, maintaining implementation simplicity while improving system performance through efficient, parameter-driven execution.
Data Source
AI summary
A method and system for handling requests from a user and rendering a resulting page in HTML useful in effectuating aspects of an order management system, which reduces the redundancy in the underlying code required to effectuate the HTML page. An embodiment of the present invention modularizes various parts of an HTML page, effectuating the re-use of certain portions of code, advantageously reducing redundancy. In one embodiment, the present invention associates each HTML page with a form mapped to a servlet in a system backend. The servlet performs appropriate action based on corresponding user action. Each user action calls a set of re-usable helper class methods. Upon completion of processing, the servlet calls a render method. The active render method internally calls re-usable render methods in helper classes. These populate NTV data used by a JSP to generate a new HTML page accordingly.


