Excellent exception processing method

An exception handling and exception technology, applied in the direction of responding to errors, etc., can solve problems such as increasing the difficulty of system maintenance, increasing the amount of platform code, and reducing research and development efficiency, so as to achieve clear business, reduce the amount of development, and improve development efficiency.

Inactive Publication Date: 2015-10-28
G CLOUD TECH
View PDF2 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The problem caused by this status quo is that business logic and exception handling logic are mixed together, making the entire system more responsible; and each business logic needs to handle corresponding exceptions, which increases the amount of code on the platform and reduces R&D efficiency; finally, When the exception handling mechanism needs to be adjusted, all business modules need to be adjusted, which is extremely inconvenient
For example, when an exception occurred on the platform before, it was enough to write the exception into the database; now, when an exception occurs, the technical staff must be notified by email to deal with it immediately, which requires all exception handling codes to be adjusted, greatly increasing the system’s maintenance difficulty

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Excellent exception processing method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0016] Such as figure 1 As shown, when the platform code throws an exception, the present invention converts the exception into the exception class A of the RuntimeException type, but does not do any processing, but throws it outward again; the platform reconfigures the Struts2 interceptor and sets it as the default interceptor, Catch the exception of type A in the interceptor and handle it uniformly; when the exception handling mechanism changes, just change the method of the interceptor.

[0017] The method includes steps such as:

[0018] Step 1, first implement the custom exception class WebException of RuntimeException;

[0019] Step 2. In the business code, convert the captured exception into a WebException type exception and throw it out;

[0020] Step 3, implement the interceptor Lo its Interceptor of struts2, and set it as the default interceptor;

[0021] Step 4, implement the intercept method of Lo's Interceptor, and capture the exception of WebException in the i...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The present invention relates to the field of JAVA technology WEB development, and particularly relates to an excellent exception processing method. The method comprises: when a code of a platform throws an exception, transforming the exception into an exception type A of a RuntimeException type, and throwing out the exception type A again instead of performing any processing; further configuring the platform with a Struts2 interceptor and setting the interceptor as a default interceptor, capturing an A type exception, and performing uniform processing; and when an exception processing mechanism changes, changing a method of the interceptor. According to the present invention, the efficiency problem of processing the exception in J2EE is effectively solved; and the method can be applied to exception processing of the J2EE.

Description

technical field [0001] The invention relates to the field of JA step A technology WEB development, and relates to an excellent exception handling method. Background technique [0002] Currently, J2EE handles exceptions by catching specific exceptions and handling them in business codes. The problem caused by this status quo is that business logic and exception handling logic are mixed together, making the entire system more responsible; and each business logic needs to handle corresponding exceptions, which increases the amount of code on the platform and reduces R&D efficiency; finally, When the exception handling mechanism needs to be adjusted, all business modules need to be adjusted, which is extremely inconvenient. For example, when an exception occurred on the platform before, it was enough to write the exception into the database; now, when an exception occurs, the technical staff must be notified by email to deal with it immediately, which requires all exception han...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/07
Inventor 关班记季统凯
Owner G CLOUD TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products