CN113126965A - Efficient development method, medium and device suitable for JSP front-end and back-end separation - Google Patents

Efficient development method, medium and device suitable for JSP front-end and back-end separation Download PDF

Info

Publication number
CN113126965A
CN113126965A CN202110478357.0A CN202110478357A CN113126965A CN 113126965 A CN113126965 A CN 113126965A CN 202110478357 A CN202110478357 A CN 202110478357A CN 113126965 A CN113126965 A CN 113126965A
Authority
CN
China
Prior art keywords
foreground
jsp
data
development
development method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110478357.0A
Other languages
Chinese (zh)
Inventor
黄遵刚
刘小明
刘晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ouye Yunshang Co ltd
Original Assignee
Ouye Yunshang Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ouye Yunshang Co ltd filed Critical Ouye Yunshang Co ltd
Priority to CN202110478357.0A priority Critical patent/CN113126965A/en
Publication of CN113126965A publication Critical patent/CN113126965A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a high-efficiency development method, medium and equipment suitable for JSP front-end and back-end separation, which are used for realizing high-efficiency development or debugging of a JSP foreground under the condition of only foreground codes and data files, and comprise the following steps: acquiring original project information, and constructing a new unified foreground project, wherein the new unified foreground project comprises a plurality of foreground modules capable of operating independently, and a code synchronous reference relationship is established between each foreground module and an original foreground catalog; extracting request data in a development test environment and storing the request data in a local file; and establishing a client engine module on the new unified foreground project, reading local file data based on the client engine module to realize request proxy, and completing development or debugging. Compared with the prior art, the method has the advantages of improving the development efficiency and the like.

Description

Efficient development method, medium and device suitable for JSP front-end and back-end separation
Technical Field
The present invention relates to a JSP project development method, and in particular, to a high-efficiency development method, medium, and device suitable for JSP front-end and back-end separation.
Background
JSP is called Java Server Pages entirely, is a dynamic webpage development technology, and embeds Java code and specific variable content into a static page to realize that a part of content in the static page is dynamically generated by taking the static page as a template, so that the updating of a user interface is more convenient, and the Search Engine Optimization (SEO) can be better supported.
And the JSP supports the background language to conveniently embed dynamic content, so that the development process and the development mode are mainly realized by a background development driver. Generally, a design drawing is firstly given to a front end to realize html template codes, and then the design drawing is given to a back end to sleeve dynamic contents on a template after the html template codes are completed. However, in the three-party docking, the situations of change of the demand, realization errors and the like often occur, which causes repeated modification and back-and-forth communication confirmation, and greatly increases the communication cost. Currently mature front and back end separation schemes can be broadly divided into two categories: one is that the effect is completely controlled at the front end, and json data is requested to change the presentation effect through the network; the other type is that an agent layer is added between a foreground and a rear end, dynamic output of foreground pages is realized through a Node (a development platform enabling JavaScript to run on a server), and the dynamic output is conveniently handed to the foreground for unified development. But for various reasons, platforms must also be developed using JSP: the first type of inconvenient SEO is mainly used in a mobile terminal and an internal system, and the second type of inconvenient SEO is added with a layer, so that more resources are invested; if the platform is already a JSP (Java Server Page) implementation platform, the cost and the influence caused by the change of a technical system, the re-implementation of full-line functions and the cross development of new functions are difficult to imagine and predict.
The JSP project generally grows larger and larger along with the development of the platform, so that it is difficult to develop a simple function and page, and the specific reasons include:
1. larger entries result in slower local boot and reload with more code volume;
2. the larger the project is, the more the project depends on the service, and the more the possibility of errors in development and debugging is greater;
3. relying on more services also makes the data needed to achieve a particular effect more difficult to obtain;
4. the micro-service architecture has more serious influence on the foreground development efficiency, and the project can not be started easily due to interface or service problems;
5. JSP project development is mainly back-end concurrent front-end development, and all personnel cannot be guaranteed to have higher technical level to realize high-level pages.
Therefore, it is necessary to develop a highly efficient development method for a complicated JSP project.
Disclosure of Invention
It is therefore an object of the present invention to overcome the above-mentioned drawbacks of the prior art and to provide a method, medium, and apparatus for efficient development suitable for JSP front-end and back-end separation.
The purpose of the invention can be realized by the following technical scheme:
a high-efficiency development method suitable for JSP front-end and back-end separation is used for realizing high-efficiency development or debugging of JSP foreground under the condition of only foreground code and data file, and comprises the following steps:
acquiring original project information, and constructing a new unified foreground project, wherein the new unified foreground project comprises a plurality of foreground modules capable of operating independently, and a code synchronous reference relationship is established between each foreground module and an original foreground catalog;
extracting request data in a development test environment and storing the request data in a local file;
and establishing a client engine module on the new unified foreground project, reading local file data based on the client engine module to realize request proxy, and completing development or debugging.
Further, the foreground module capable of running independently is established by using a springboot structure.
Further, the code synchronous reference relation is established by utilizing the svn: externals attribute.
Further, the extracting request data in the development test environment specifically includes:
and intercepting each request result by adopting a unified Aspect, and caching the latest N times of request data by taking the requested 'method + servletPath' as a key, wherein N is 15-25.
Further, the implementation of the request agent by using the client engine module specifically includes:
and expressing the feedback data of different network requests by uniform object data, and reading the local file data by the client engine module in a corresponding mode according to the received different network requests.
Further, the network request comprises a page request and an ajax request;
for a page request, a client engine module is firstly redirected to a controller which can uniformly return ModelAndView, and then the controller reads local file data; for ajax requests, the client engine module reads the local file data directly.
Further, the unified object data is json data.
Further, changing the local file data implements a different service policy.
The present invention also provides a computer readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, the one or more programs including instructions for performing an efficient development method that accommodates JSP front-end separation as described above.
The present invention also provides an electronic device comprising:
one or more processors;
a memory; and
one or more programs stored in the memory, the one or more programs including instructions for performing an efficient development method that accommodates JSP front-end separation as described above.
Compared with the prior art, the method can realize the front-end and back-end separated development to the greatest extent, is easy to reduce the communication cost, improve the development efficiency, improve the development quality and accelerate the online progress, and has the following beneficial effects:
1. the invention only keeps concerned JSP foreground agent by stripping background code, solves the problem that JSP project is started and reloaded slowly to affect foreground development efficiency due to service dependence, converts the idea that JSP foreground and background logic can only be operated and developed in one project, can develop foreground and background by different professionals at the same time, and can develop foreground and background by one person in stages.
2. Foreground files in all foreground projects are extracted to be unified foreground projects which do not relate to back-end logic, complex background logic is isolated through local file data proxy service, and the problem that JSP foreground logic codes are tightly coupled with background controller service to influence foreground development efficiency is solved.
3. Uniformly appointing the page object and the ajax request result object, and expressing the page object and the ajax request result object in a json data mode; and then the request can be forwarded to read the json file of the corresponding path through program control to provide service, so that the service with complex shielding rear-end logic and time-consuming operation is achieved.
4. And establishing a relatively convenient on-line functional data and local verification data synchronization mechanism.
5. By directly modifying the file data of the service by the agent to support the requirement of the foreground on the service change, the problem that the JSP foreground effect development cannot control the dependent service data (the result generated by reading a database, a remote service structure, complex logic operation and the like which are conveniently mastered by non-front-end personnel) so as to influence the foreground development efficiency is solved.
6. The JSP front-end and back-end separation scheme provides a thought, and is beneficial to work division of professionals or front-end and back-end work division of back-end development, and development efficiency is improved.
7. The foreground code of each project is centralized to a uniform project, and is also beneficial to adding and modifying the global effect in each module.
8. By means of the mode, a development foreground can be understood first, and functional points can be arranged and refined synchronously, so that the model definition of the service is facilitated, and the rework is reduced.
Drawings
Fig. 1 is a schematic diagram of the principle of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of the present invention is not limited to the following embodiments.
The embodiment provides a high-efficiency development method suitable for JSP front-end and back-end separation, a JSP front-end separation development mode is provided based on the combination of isolation, proxy, cache, synchronization and other ideas, the JSP front-end separation development mode is mainly realized by utilizing springboot, I/O, Filter, Aspect, LinkedHashMap and nginx technologies, and the JSP foreground is efficiently developed or debugged under the condition that only foreground codes and data files exist.
As shown in fig. 1, the method comprises the steps of: acquiring original project information, and constructing a new unified foreground project, wherein the new unified foreground project comprises a plurality of foreground modules capable of operating independently, and a code synchronous reference relationship is established between each foreground module and an original foreground catalog; extracting request data in a development test environment and storing the request data in a local file; and a client engine module is established in the new unified foreground project, and the client engine module reads local file data to realize request proxy and complete development or debugging. The method realizes the high-efficiency development of front-end and back-end separation by means of isolating codes, synchronizing foreground codes and isolating logic services.
The method is specifically described as follows:
1) establishing a new unified foreground project, wherein each foreground module corresponds to an actual foreground project and can be started;
2) and linking the webapp catalogs in the modules to the webapp catalogs of the corresponding actual items through svn: extrinsic attributes to keep the codes on the two sides synchronized in real time.
3) And realizing and integrating the client engine module.
31) The network requests are divided into pages and ajax: the page request is to return a ModelAndView object, and the ajax request is to return any object, so that the page data and the ajax data can be unified into an object and expressed by json;
32) newly adding a data directory (and src directory level) in each foreground module, and storing the json data requested by the requests by dividing the directory by paths;
33) and establishing a client engine module to realize that the custom ProxyDataRequestFilter uniformly converts the request into the read local file data.
4) The request result of the synchronous development test environment is a local data file.
41) The method comprises the steps that a uniform controllerResultAspect section is integrated in a running project, each request can be intercepted after the command is issued to a development test environment, a result is cached by taking a request 'method + servletPath' as a key, and latest N times of request data are cached, in the embodiment, 20 is taken from N, and the storage path of json data is consistent with the request 'method + servletPath';
42) providing unified path "/common/mock/cache" to query the most recently requested cache in step 41);
43) and functions of resolving and converting server cache data into a local path file are integrated in the client engine module.
5) Under the condition that foreground page codes, service data and a client engine are all provided, a specific page can be accessed for function development and debugging after a corresponding module is started, and different service strategies can be changed by changing file data.
The above functions, if implemented in the form of software functional units and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another embodiment, an electronic device is provided that includes one or more processors, memory, and one or more programs stored in the memory that include instructions for performing an efficient development method that accommodates JSP front-end separation as described above.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (10)

1. A high-efficiency development method suitable for JSP front-end and back-end separation is used for realizing high-efficiency development or debugging of a JSP foreground under the condition of only foreground codes and data files, and comprises the following steps:
acquiring original project information, and constructing a new unified foreground project, wherein the new unified foreground project comprises a plurality of foreground modules capable of operating independently, and a code synchronous reference relationship is established between each foreground module and an original foreground catalog;
extracting request data in a development test environment and storing the request data in a local file;
and establishing a client engine module on the new unified foreground project, reading local file data based on the client engine module to realize request proxy, and completing development or debugging.
2. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 1, wherein the foreground modules capable of running independently are built using a springboot structure.
3. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 1, characterized in that the code synchronous reference relationship is established using svn: externals attribute.
4. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 1, wherein the extracting request data in the development test environment is specifically:
and intercepting each request result by adopting a unified Aspect, and caching the latest N times of request data by taking the requested 'method + servletPath' as a key, wherein N is 15-25.
5. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 1, wherein the implementation of the request agent by using the client engine module specifically comprises:
and expressing the feedback data of different network requests by uniform object data, and reading the local file data by the client engine module in a corresponding mode according to the received different network requests.
6. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 5, wherein the network requests comprise page requests and ajax requests;
for a page request, a client engine module is firstly redirected to a controller which can uniformly return ModelAndView, and then the controller reads local file data; for ajax requests, the client engine module reads the local file data directly.
7. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 5, wherein the unified object data is json data.
8. The efficient development method applicable to JSP front-end and back-end separation as claimed in claim 1, wherein changing the local file data implements different service policies.
9. A computer readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, the one or more programs including instructions for performing the efficient development method for applicable JSP front-end separation of any of claims 1-8.
10. An electronic device, comprising:
one or more processors;
a memory; and
one or more programs stored in the memory, the one or more programs including instructions for performing the efficient development method for accommodating JSP front-end separation as recited in any of claims 1-8.
CN202110478357.0A 2021-04-30 2021-04-30 Efficient development method, medium and device suitable for JSP front-end and back-end separation Pending CN113126965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110478357.0A CN113126965A (en) 2021-04-30 2021-04-30 Efficient development method, medium and device suitable for JSP front-end and back-end separation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110478357.0A CN113126965A (en) 2021-04-30 2021-04-30 Efficient development method, medium and device suitable for JSP front-end and back-end separation

Publications (1)

Publication Number Publication Date
CN113126965A true CN113126965A (en) 2021-07-16

Family

ID=76780821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110478357.0A Pending CN113126965A (en) 2021-04-30 2021-04-30 Efficient development method, medium and device suitable for JSP front-end and back-end separation

Country Status (1)

Country Link
CN (1) CN113126965A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407099A (en) * 2015-07-28 2017-02-15 阿里巴巴集团控股有限公司 Test method and client
CN108600311A (en) * 2018-03-21 2018-09-28 浙江口碑网络技术有限公司 The method and device of client simulation interface data
CN109857391A (en) * 2019-01-18 2019-06-07 山石网科通信技术股份有限公司 Processing method and processing device, storage medium and the electronic device of data
CN110502224A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Interface analogy method, device and computer equipment based on HTTP request
CN110531968A (en) * 2019-08-20 2019-12-03 广州华资软件技术有限公司 A method of detaching web front-end function code generates independent template automatically
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407099A (en) * 2015-07-28 2017-02-15 阿里巴巴集团控股有限公司 Test method and client
CN108600311A (en) * 2018-03-21 2018-09-28 浙江口碑网络技术有限公司 The method and device of client simulation interface data
CN109857391A (en) * 2019-01-18 2019-06-07 山石网科通信技术股份有限公司 Processing method and processing device, storage medium and the electronic device of data
CN110531968A (en) * 2019-08-20 2019-12-03 广州华资软件技术有限公司 A method of detaching web front-end function code generates independent template automatically
CN110502224A (en) * 2019-08-22 2019-11-26 深圳前海环融联易信息科技服务有限公司 Interface analogy method, device and computer equipment based on HTTP request
CN111290753A (en) * 2020-01-20 2020-06-16 远光软件股份有限公司 Method, device, equipment and storage medium for building front-end development environment

Similar Documents

Publication Publication Date Title
US20200167529A1 (en) Translation Review Workflow Systems and Methods
EP3896567B1 (en) Page pre-rendering method and apparatus, electronic device, and storage medium
US9646041B2 (en) Testing of inactive design-time artifacts
CN108037961A (en) A kind of application program collocation method, device, server and storage medium
CN110825388B (en) Method for directly converting SQL statement into corresponding REST interface
US20070261049A1 (en) Techniques to perform gradual upgrades
US20140280259A1 (en) Run-time sql language translation
US11663288B2 (en) Just-in-time front end template generation using logical document object models
CN110858172A (en) Automatic test code generation method and device
US11995075B2 (en) System and method for efficient transliteration of machine interpretable languages
CN103257958A (en) Cloud storage based translating method and system
CN111950300B (en) Translation management method and device for universal software entries, storage medium and server
CN112905178A (en) Method, device, equipment and medium for generating business function page
CN113126965A (en) Efficient development method, medium and device suitable for JSP front-end and back-end separation
CN114064601A (en) Storage process conversion method, device, equipment and storage medium
CN114153547B (en) Management page display method and device
CN115758016A (en) Webpage content staticizing processing method and system
CN114564404A (en) System and method for joint debugging simulation of third-party system
CN110502761B (en) Translation platform and load adjustment method thereof
CN112486460A (en) Method, system, device and medium for automatically importing interface document
US20240152511A1 (en) Transliteration of machine interpretable languages for enhanced compaction
US11789947B2 (en) Independent object generator and wrapper engine
CN115563183B (en) Query method, query device and program product
CN115756528A (en) Static AMD website development service implementation method, system, equipment and medium
CN118295751A (en) Multilingual management system, method, electronic device, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination