CN114356439B - Method for starting WEB application in offline installation-free manner - Google Patents
Method for starting WEB application in offline installation-free manner Download PDFInfo
- Publication number
- CN114356439B CN114356439B CN202111570596.5A CN202111570596A CN114356439B CN 114356439 B CN114356439 B CN 114356439B CN 202111570596 A CN202111570596 A CN 202111570596A CN 114356439 B CN114356439 B CN 114356439B
- Authority
- CN
- China
- Prior art keywords
- file
- web application
- script file
- platform
- jre
- 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.)
- Active
Links
Images
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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 a WEB application without offline installation, which is convenient for starting the WEB application and comprises the following steps: acquiring a JRE corresponding to a platform; adding an implementation class into a WEB application program based on Java language, packaging the implementation class into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder; newly creating an installation-free version database, 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 a database of an installation-free version, and then a Jar package is compiled and operated by using a JRE, so that the class can be automatically called and a second script file is started after the Jar package is started; and opening a webpage file after the second script file is started, automatically starting a 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 codes to finish the starting of the WEB application program.
Description
Technical Field
The invention relates to the technical field of WEB, in particular to a method for starting a WEB application in an offline installation-free manner.
Background
With the development of the internet, more and more enterprises have various website systems, and after some websites of the enterprises are on line for a period of time, the websites can be off line due to the saving of server resources and the like, but after the websites are off line, the requirements of users for inquiring historical data of the websites are difficult to meet, and great inconvenience is caused to the users.
Disclosure of Invention
The invention aims to provide a method for starting a WEB application in an off-line installation-free manner, so as to conveniently start the WEB application under the conditions of no connection with a network and no installation of any program.
The technical scheme adopted by the invention for solving the technical problems is as follows: the method for starting the WEB application in an off-line installation-free manner comprises the following steps of:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining a byte code file for executing Java;
step 2, adding a realization class of CommandLineRunner in a WEB application program based on Java language, packaging the realization class into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder;
step 3, creating a database, a webpage file, a first script file and a second script file of an installation-free version in the folder;
step 4, after the first script file is started, the first script file starts a database of an installation-free version, then a Jar package is compiled and operated by using a JRE, and the implementation class automatically calls and starts a second script file after the Jar package is started;
and 5, opening a webpage file after the second script file is started, automatically starting a browser by a platform after the webpage file is opened, and pointing the website of the browser to the local website of the WEB application program by JS codes in the webpage file to finish the starting of the WEB application program.
As a further optimization, the platform is a Windows platform, a Linux platform or a Mac platform.
As a 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 an Internet server.
The beneficial effects of the invention are as follows: the method for starting the WEB application without offline installation constructs a method for starting the WEB website application program in the hard disk or the U disk under the condition that the computer is not connected with a network and no program is required to be installed. 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 offline and iterated.
Drawings
Fig. 1 is a flowchart of a method for starting up a WEB application without offline installation 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 offline installation, which comprises the following steps: acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining a byte code file for executing Java; adding a CommandLineRunner realization class into a Java-language-based WEB application program, packaging the Java-language-based WEB application program into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder; newly creating an installation-free version database, 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 a JRE is used for compiling and running a Jar package, and the implementation class automatically calls and starts a second script file after the Jar package is started; and opening a webpage file after the second script file is started, automatically starting a browser by a platform after the webpage file is opened, and pointing the website of the browser to the local website of the WEB application program by JS codes in the webpage file to finish the starting of the WEB application program.
Specifically, the main principle of the invention is to utilize the cross-platform characteristic of Java language, i.e. Java language running on the computer is not limited by the platform, which refers to the operating system of the computer, for example: windows, linux, mac, etc. The cross-platform means that Java programs can run on each platform after one-time compiling. Firstly packaging a Java-language WEB application program into a Jar package, then placing the Jar package and a JRE of a corresponding platform in a folder, wherein the JRE is an indispensable running environment for running a program written based on Java language and is used for explaining and executing Java byte code files, a database of an installation-free version, a webpage file and a second script file for opening the webpage are also required to be placed in the folder, finally, a first started script file is added in the folder, the first script file plays a role of starting the database of the installation-free version firstly, then compiling and running the Jar package by using the JRE, the Jar package can automatically call the second script file for opening the webpage in the folder after the Jar package is started, after the webpage file in the folder is opened by the second script file, a section of JS code is automatically started by a computer, the JS code can point a website to a local website of the WEB application program, and finally, the installation-free running and the WEB application program is realized.
Examples
The method for starting the WEB application without offline installation, which is disclosed by the embodiment of the invention, is shown in fig. 1, and comprises the following steps:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining a byte code file for executing Java;
specifically, the JRE corresponding to the platform needs to be downloaded first, for example, when the Windows platform is running, the JRE of the Windows platform is downloaded, and the JRE is an operation environment necessary for running a program written based on the Java language, and is used for explaining a bytecode file for executing Java.
Step 2, adding a realization class of CommandLineRunner in a WEB application program based on Java language, packaging the realization class into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder;
it can be understood that a realization class of CommandLineRunner is added in the WEB application program of Java language, and the realization class is used for automatically calling a second script file for opening a webpage in a folder after the starting of the WEB application program is completed.
Wherein, the code of the realization class of the CommandLineRunner is as follows:
step 3, creating a database, a webpage file, a first script file and a second script file of an installation-free version in the folder;
the database of the installation-free version may be a MySQL installation-free version database.
The webpage file contains a section of JS codes, the codes can point the website of the automatically opened browser to the local website of the WEB application, the webpage file is named as index. Html, and the content of the JS codes is as follows:
<script>
location.href=′http://127.0.0.1:8090/′;
</script>
the first script file is used for starting the database and jar files, and if the first script file is a Windows platform, the first script file is named as "starting application. Bat", 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
the second script file is used for opening the index. Html of the webpage file, then automatically starting the browser of the computer, if the browser platform is a Windows platform, the script file is named as handle. Bat, and the content of the second script file is as follows:
index.html
step 4, after the first script file is started, the first script file starts a database of an installation-free version, then a Jar package is compiled and operated by using a JRE, and the implementation class automatically calls and starts a second script file after the Jar package is started;
and 5, opening a webpage file after the second script file is started, automatically starting a browser by a platform after the webpage file is opened, and pointing the website of the browser to the local website of the WEB application program by JS codes in the webpage file to finish the starting of the WEB application program.
Specifically, after all files in the folder are built, the first script file is started, so that the WEB application program can be started by one key under the condition that the computer is not connected with a network and no program needs to be installed, and the specific implementation flow is as follows:
after a first script file of the application, bat, is started, a database is started first, then a Jar file is started by using a JRE, a second script file, handle, bat, for opening a webpage is automatically called after the Jar package is started, the script file can open the webpage file in a folder, at the moment, a browser is automatically started by a computer, JS codes in the webpage file can point a website to a local website of the WEB application, and therefore the WEB website application program can be started by one key under the conditions that the computer is not connected with a network and no program is required to be installed.
And 6, 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 offline and version update can be performed on the WEB application.
Claims (1)
1. The method for starting the WEB application in an off-line installation-free manner is characterized by comprising the following steps of:
step 1, acquiring a JRE corresponding to a platform, wherein the JRE is used for explaining a byte code file for executing Java;
the platform is a Windows platform, a Linux platform or a Mac platform;
step 2, adding a realization class of CommandLineRunner in a WEB application program based on Java language, packaging the realization class into a Jar package, and storing the Jar package and a JRE corresponding to a platform in a folder;
the implementation class is used for automatically calling a second script file for opening the webpage in the folder after the WEB application program is started;
step 3, creating a database, a webpage file, a first script file and a second script file of an installation-free version in the folder;
the database of the installation-free version is a MySQL installation-free version database, the webpage file comprises a section of JS codes, the first script file is used for starting the database and compiling and running a Jar package by using a JRE, and the second script file is used for opening the webpage file;
step 4, after the first script file is started, the first script file starts a database of an installation-free version, then a Jar package is compiled and operated by using a JRE, and the implementation class automatically calls and starts a second script file after the Jar package is started;
step 5, opening a webpage file after the second script file is started, automatically starting a browser by a platform after the webpage file is opened, and pointing the website of the browser to the local website of the WEB application program by JS codes in the webpage file to finish the starting of the WEB application program;
the method further comprises the steps of:
and when the platform is connected with the Internet, automatically downloading and updating the WEB application program from an Internet server.
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 CN114356439A (en) | 2022-04-15 |
CN114356439B true 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 (8)
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 |
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 |
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 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030093508A1 (en) * | 2001-10-18 | 2003-05-15 | Seiko Epson Corporation | System for installing and launching network applications |
US10560540B2 (en) * | 2016-12-12 | 2020-02-11 | Sap Se | Optimizing provisioning of Java-based web applications on PaaS like cloud foundry |
-
2021
- 2021-12-21 CN CN202111570596.5A patent/CN114356439B/en active Active
Patent Citations (8)
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 |
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 |
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 (4)
Title |
---|
WEB应用打成jar包全记录;a18301566808;《https://blog.csdn.net/a18301566808/article/details/101832792》;第1-3页 * |
基于HTML5构建离线Web应用的研究与探讨;瞿苏;《佛山科学技术学院学报(自然科学版)》;第34卷(第3期);第61-64页 * |
巅峰卓越.《移动Web开发从入门到精通》.人民邮电出版社,2017,全文. * |
开发支持离线的Web应用程序;即将入土的羸弱老年人;《https://blog.csdn.net/qq_36823300/article/details/101616992》;第1-6页 * |
Also Published As
Publication number | Publication date |
---|---|
CN114356439A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100441115B1 (en) | Java Compile-On-Demand Service System for Accelerating Processing Speed of Java Program on Data Processing System And Method Thereof | |
CN105100191B (en) | The method, apparatus and system of Java application installations are realized in a kind of cloud compiling | |
EP2916243B1 (en) | Method, apparatus, server and system for implementing web application | |
US6748591B1 (en) | Method, system, program, and data structures for loading programs into a runtime environment | |
CN101945135A (en) | Method and system for upgrading widget system | |
US20090131035A1 (en) | Systems and methods for executing an application on a mobile device | |
EP1872215A1 (en) | Implementing data-compatibility-based version scheme | |
CN109947433A (en) | A kind of generation method of small routine, update method and device | |
CN106406961A (en) | Method and device for loading and providing application based on browser | |
CN104714827A (en) | Plug-in update method and device | |
CN1991757A (en) | Method for realizing software updating | |
CN111176625A (en) | Method for efficiently compiling identity intelligent contract at browser end | |
KR101117165B1 (en) | Web platform unit for mobile terminal connectioned web-application program in heterogeneous operating system | |
CN114356439B (en) | Method for starting WEB application in offline installation-free manner | |
CN112860251A (en) | Method and system for constructing website front end | |
CN108733388A (en) | A kind of H5 page parsing methods wrapped offline based on Native | |
US20130332568A1 (en) | Method of data processing by a navigation module | |
CN105786565A (en) | Method for calling background control program through WEB end | |
CN110018816B (en) | Virtual machine control system based on C/C + + compiling system and control method thereof | |
CN116303096B (en) | Method for debugging local component code of low-code designer | |
CN113190268B (en) | Packaging method of front-end source item | |
CN117348948B (en) | Applet engine running on self-contained App | |
CN116821538A (en) | H5 page loading method | |
CN111026563B (en) | Interface calling method and device, storage medium and electronic equipment | |
CN114968232A (en) | Method for offline construction of electron-based application |
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 |