CN114356439A - Method for starting WEB application without installation in offline mode - Google Patents

Method for starting WEB application without installation in offline mode Download PDF

Info

Publication number
CN114356439A
CN114356439A CN202111570596.5A CN202111570596A CN114356439A CN 114356439 A CN114356439 A CN 114356439A CN 202111570596 A CN202111570596 A CN 202111570596A CN 114356439 A CN114356439 A CN 114356439A
Authority
CN
China
Prior art keywords
web application
installation
platform
file
script file
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.)
Granted
Application number
CN202111570596.5A
Other languages
Chinese (zh)
Other versions
CN114356439B (en
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.)
Sichuan Qiruike Technology Co Ltd
Original Assignee
Sichuan Qiruike Technology 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 Sichuan Qiruike Technology Co Ltd filed Critical Sichuan Qiruike Technology Co Ltd
Priority to CN202111570596.5A priority Critical patent/CN114356439B/en
Publication of CN114356439A publication Critical patent/CN114356439A/en
Application granted granted Critical
Publication of CN114356439B publication Critical patent/CN114356439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of WEB, and discloses a method for starting WEB application without installation in an off-line manner, which is convenient for starting the WEB application and comprises the following steps: acquiring a JRE corresponding to the platform; adding an implementation class in a Java language-based WEB application program, packaging the implementation class into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder; newly building a database of an installation-free version, a webpage file, a first script file and a second script file in a folder; after the first script file is started, the first script file starts the database of the installation-free version, then uses JRE to compile and run the Jar package, and realizes that the class automatically calls and starts the second script file after the Jar package is started; and opening the webpage file after the second script file is started, automatically starting the browser by the platform after the webpage file is opened, and pointing the website of the browser to the local website of the WEB application program by the JS code to finish the starting of the WEB application program.

Description

Method for starting WEB application without installation in offline mode
Technical Field
The invention relates to the technical field of WEB, in particular to a method for starting WEB application without installation offline.
Background
With the development of the internet, more and more enterprises have various website systems, some of the websites of the enterprises may be offline for some time due to the conservation of server resources, etc., but after the websites are offline, the requirement of the user for inquiring the website history data is difficult to meet, and great inconvenience is brought to the user.
Disclosure of Invention
The invention aims to provide an off-line installation-free method for starting WEB application, so that the WEB application can be conveniently started without connecting a network and installing any program.
The technical scheme adopted by the invention for solving the technical problems is as follows: the method for starting the WEB application without installation in an off-line manner comprises the following steps:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining and executing a byte code file of Java;
step 2, adding a Command LineRunner implementation class in a Java language-based WEB application program, packaging the Java application program into a Jar package, and storing the Jar package and a JRE corresponding to the platform in a folder;
step 3, newly building a database of an installation-free version, a webpage file, a first script file and a second script file in the folder;
step 4, after the first script file is started, the first script file starts a database of the installation-free version, then a JRE is used for compiling and running the Jar package, and the implementation class automatically calls and starts a second script file after the Jar package is started;
and 5, opening the webpage file after the second script file is started, automatically starting the browser by the platform after the webpage file is opened, and enabling the JS code in the webpage file to point the website of the browser to the local website of the WEB application program to finish the starting of the WEB application program.
As further optimization, the platform is a Windows platform, a Linux platform or a Mac platform.
And as further optimization, the database of the installation-free version is a MySQL installation-free version database.
As a further optimization, the method further comprises:
and when the platform is connected with the Internet, automatically downloading and updating the WEB application program from the Internet server.
The invention has the beneficial effects that: the method for starting the WEB application without installation offline provided by the invention constructs a method for starting the WEB site application program in a hard disk or a U disk under the condition that a computer is not connected with a network and does not need to install any program, and the method solves the problem that the WEB application can be continuously and conveniently used after being offline. And if the computer is connected with the Internet, the WEB application can automatically download the latest program from the Internet server and update the WEB application, so that the WEB application can be operated off line and updated and iterated.
Drawings
Fig. 1 is a schematic flow chart of a method for starting a WEB application without installation offline according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
The invention provides a method for starting WEB application without installation in an off-line manner, which comprises the following steps: acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining and executing a byte code file of Java; adding a Command LineRunner implementation class in a Java language-based WEB application program, packaging into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder; newly building a database of an installation-free version, a webpage file, a first script file and a second script file in the folder; after the first script file is started, the first script file starts a database of an installation-free version, then uses JRE to compile and run a Jar package, and the implementation class automatically calls and starts a second script file after the Jar package is started; and opening the webpage file after the second script file is started, automatically starting the browser by the platform after the webpage file is opened, and enabling the JS code in the webpage file to point the website of the browser to the local website of the WEB application program to finish the starting of the WEB application program.
Specifically, the main principle of the present invention is to utilize the cross-platform characteristics of Java language, i.e. the Java language runs on a computer without being constrained by a platform, which refers to the operating system of the computer, such as: windows, Linux, Mac, etc. The cross-platform means that the Java program can run on each platform after being compiled once. The method comprises the following steps of firstly packaging a Java WEB application program into a Jar package, then placing the Jar package and a JRE of a corresponding platform into a folder, wherein the JRE is an indispensable running environment for running a program written based on the Java language and is used for explaining and executing Java byte code files, the folder also needs to be provided with an installation-free version database, a webpage file and a second script file for opening a webpage, and finally a started first script file is added into the folder, the first script file is used for starting the installation-free version database, then compiling and running the Jar package by using the JRE, the second script file for opening the webpage in the folder can be automatically called after the Jar package is started, after the second script file opens the webpage file in the folder, a browser is automatically started by a computer, the webpage file contains a section of JS code, the JS code will direct the WEB address to a local WEB address of the WEB application, and finally offline and installation-free operation and use of the WEB application are achieved.
Examples
The method for starting the WEB application without installation in an offline manner, which is disclosed by the embodiment of the invention, as shown in FIG. 1, comprises the following steps:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining and executing a byte code file of Java;
specifically, it is first necessary to download the JRE corresponding to the platform, for example, when the Windows platform is running, the JRE of the Windows platform is downloaded, and the JRE is an indispensable running environment for running programs written based on the Java language, and is used for interpreting and executing the Java bytecode file.
Step 2, adding a Command LineRunner implementation class in a Java language-based WEB application program, packaging the Java application program into a Jar package, and storing the Jar package and a JRE corresponding to the platform in a folder;
it can be understood that an implementation class of CommandLineRunner is added in the WEB application program in Java language, and the implementation class is used for enabling the WEB application program to automatically call the second script file for opening the WEB page in the folder after the WEB application program is started.
Wherein the code of the implementation class of the CommandLineRunner is as follows:
Figure BDA0003423566710000031
step 3, newly building a database of an installation-free version, a webpage file, a first script file and a second script file in the folder;
the database of the installation-free version can be a MySQL installation-free version database.
The webpage file comprises a JS code, the JS code can direct the website of the browser automatically opened to a local website of WEB application, and the webpage file is named as' index.
<script>
location.href=′http://127.0.0.1:8090/′;
</script>
The first script file is used for starting the database and jar files, and is named as 'starting application in case of Windows platform', and the content of the first script file is as follows:
start mysql\bin\mysqld.exe--default-character-set=gbk
start jre/bin/java-jar file/projects-1.0-SNAPSHOT.jar
html, then automatically starting a browser of a computer, and if the script file is a Windows platform, the script file is named as "handle.
index.html
Step 4, after the first script file is started, the first script file starts a database of the installation-free version, then a JRE is used for compiling and running the Jar package, and the implementation class automatically calls and starts a second script file after the Jar package is started;
and 5, opening the webpage file after the second script file is started, automatically starting the browser by the platform after the webpage file is opened, and enabling the JS code in the webpage file to point the website of the browser to the local website of the WEB application program to finish the starting of the WEB application program.
Specifically, after all files in the folder are established, the first script file is started, that is, the WEB application program can be started by one key under the condition that the computer is not connected with a network and does not need to install any program, and the specific implementation flow is as follows:
after the first script file of the ' start application ' bat ' is operated, firstly, a database is started, then a Jar file is operated by using JRE, a second script file ' handle.bat ' for opening a webpage is automatically called after a Jar package is started, the script file opens the webpage file in a folder, the computer automatically starts a browser, and a JS code in the webpage file points to a local website of the WEB application, so that the WEB website application program can be started by one key under the condition that the computer is not connected with a network and does not need to install any program.
And 6, if the computer is connected with the Internet, the WEB application also automatically downloads the latest program from an Internet server and updates the WEB application, so that the WEB application can be operated off line and also can be updated.

Claims (4)

1. The method for starting the WEB application without installation in an offline manner is characterized by comprising the following steps:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining and executing a byte code file of Java;
step 2, adding a Command LineRunner implementation class in a Java language-based WEB application program, packaging the Java application program into a Jar package, and storing the Jar package and a JRE corresponding to the platform in a folder;
step 3, newly building a database of an installation-free version, a webpage file, a first script file and a second script file in the folder;
step 4, after the first script file is started, the first script file starts a database of the installation-free version, then a JRE is used for compiling and running the Jar package, and the implementation class automatically calls and starts a second script file after the Jar package is started;
and 5, opening the webpage file after the second script file is started, automatically starting the browser by the platform after the webpage file is opened, and enabling the JS code in the webpage file to point the website of the browser to the local website of the WEB application program to finish the starting of the WEB application program.
2. The method for offline installation-free launching of a WEB application according to claim 1, wherein the platform is a Windows platform, a Linux platform or a Mac platform.
3. The method for offline installation-free launching of a WEB application according to claim 1, wherein the installation-free version database is a MySQL installation-free version database.
4. The method for offline installation-free launching of a WEB application according to claim 1, further comprising:
and when the platform is connected with the Internet, automatically downloading and updating the WEB application program from the Internet server.
CN202111570596.5A 2021-12-21 2021-12-21 Method for starting WEB application in offline installation-free manner Active CN114356439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111570596.5A CN114356439B (en) 2021-12-21 2021-12-21 Method for starting WEB application in offline installation-free manner

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111570596.5A CN114356439B (en) 2021-12-21 2021-12-21 Method for starting WEB application in offline installation-free manner

Publications (2)

Publication Number Publication Date
CN114356439A true CN114356439A (en) 2022-04-15
CN114356439B CN114356439B (en) 2023-06-13

Family

ID=81100701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111570596.5A Active CN114356439B (en) 2021-12-21 2021-12-21 Method for starting WEB application in offline installation-free manner

Country Status (1)

Country Link
CN (1) CN114356439B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19942432A1 (en) * 1999-09-06 2001-03-08 Iconparc Gmbh Offline web application execution method uses web browser for loading offline web application stored on offline storage medium into personal computer for dynamic web page generation
US6546554B1 (en) * 2000-01-21 2003-04-08 Sun Microsystems, Inc. Browser-independent and automatic apparatus and method for receiving, installing and launching applications from a browser on a client computer
US20030093508A1 (en) * 2001-10-18 2003-05-15 Seiko Epson Corporation System for installing and launching network applications
US6584612B1 (en) * 1999-07-15 2003-06-24 International Business Machines Corporation Transparent loading of resources from read-only memory for an application program
CN101277221A (en) * 2008-05-15 2008-10-01 中兴通讯股份有限公司 Method for disposition and application of network management application program
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
US20180167480A1 (en) * 2016-12-12 2018-06-14 Sap Se Optimizing provisioning of java-based web applications on paas like cloud foundry
CN109375929A (en) * 2018-11-22 2019-02-22 东软集团股份有限公司 Installation kit generation method, device, storage medium and the equipment of Java web application
CN109683957A (en) * 2018-11-28 2019-04-26 厦门中控智慧信息技术有限公司 The method and apparatus of Function Extension
CN110825429A (en) * 2019-11-13 2020-02-21 中孚安全技术有限公司 Web project packaging method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6584612B1 (en) * 1999-07-15 2003-06-24 International Business Machines Corporation Transparent loading of resources from read-only memory for an application program
DE19942432A1 (en) * 1999-09-06 2001-03-08 Iconparc Gmbh Offline web application execution method uses web browser for loading offline web application stored on offline storage medium into personal computer for dynamic web page generation
US6546554B1 (en) * 2000-01-21 2003-04-08 Sun Microsystems, Inc. Browser-independent and automatic apparatus and method for receiving, installing and launching applications from a browser on a client computer
US20030093508A1 (en) * 2001-10-18 2003-05-15 Seiko Epson Corporation System for installing and launching network applications
CN101277221A (en) * 2008-05-15 2008-10-01 中兴通讯股份有限公司 Method for disposition and application of network management application program
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
US20180167480A1 (en) * 2016-12-12 2018-06-14 Sap Se Optimizing provisioning of java-based web applications on paas like cloud foundry
CN109375929A (en) * 2018-11-22 2019-02-22 东软集团股份有限公司 Installation kit generation method, device, storage medium and the equipment of Java web application
CN109683957A (en) * 2018-11-28 2019-04-26 厦门中控智慧信息技术有限公司 The method and apparatus of Function Extension
CN110825429A (en) * 2019-11-13 2020-02-21 中孚安全技术有限公司 Web project packaging method and system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A18301566808: "WEB应用打成jar包全记录", 《HTTPS://BLOG.CSDN.NET/A18301566808/ARTICLE/DETAILS/101832792》, pages 1 - 3 *
即将入土的羸弱老年人: "开发支持离线的Web应用程序", 《HTTPS://BLOG.CSDN.NET/QQ_36823300/ARTICLE/DETAILS/101616992》, pages 1 - 6 *
瞿苏: "基于HTML5构建离线Web应用的研究与探讨", 《佛山科学技术学院学报(自然科学版)》, vol. 34, no. 3, pages 61 - 64 *

Also Published As

Publication number Publication date
CN114356439B (en) 2023-06-13

Similar Documents

Publication Publication Date Title
US7174544B2 (en) JAVA compile-on-demand service system for accelerating processing speed of JAVA program in data processing system and method thereof
US7941797B2 (en) Dynamically providing native libraries and their dependencies
US8127288B2 (en) Installing and updating interpreted programming language applications using a designated virtual machine
US10296323B2 (en) System and method for fast initial and incremental deployment of apps
CN105100191B (en) The method, apparatus and system of Java application installations are realized in a kind of cloud compiling
US5727147A (en) System and method for resolving symbolic references to externally located program files
US6748591B1 (en) Method, system, program, and data structures for loading programs into a runtime environment
US7640153B2 (en) Networked client-server architecture for transparently transforming and executing applications
US9519466B2 (en) Executable code for constrained computing environments
CN105512324B (en) A kind of front-end module loader of packaging file local updating
US8056062B2 (en) Methods and systems for converting application code in turbine control systems
CN111381852A (en) Application dynamic updating method and device based on Flutter, storage medium and electronic equipment
CN105786538A (en) Software upgrading method and device based on Android system
KR102052776B1 (en) Installation engine and package format for parallelizable, reliable installations
CN111176625A (en) Method for efficiently compiling identity intelligent contract at browser end
CN112799663A (en) Page display method and device, computer readable storage medium and electronic equipment
KR101117165B1 (en) Web platform unit for mobile terminal connectioned web-application program in heterogeneous operating system
CN101169726A (en) Embedded type Linux system on-line upgrading method based on MTD partition
CN108376074B (en) RancherOS ros core module transplanting method based on embedded system
CN114356439B (en) Method for starting WEB application in offline installation-free manner
CN112835568A (en) Project construction method and device
EP1221091B1 (en) Loading object-oriented computer programs
CN110874226B (en) Android system function upgrading method
US20070277170A1 (en) Merger driven application installation
CN117573154B (en) Method and device for optimizing desktop application installation package based on electronics on Linux system

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
GR01 Patent grant
GR01 Patent grant