— Scott McNealy, Sun Microsystems Chairman, President and ceo


% Local Combination 100% Remote



Download 40,57 Mb.
Pdf ko'rish
bet553/555
Sana26.05.2022
Hajmi40,57 Mb.
#609235
1   ...   547   548   549   550   551   552   553   554   555
Bog'liq
Head First Java (Kathy Sierra, Bert Bates) (z-lib.org)

100% Local Combination 100% Remote
Servlets
HTTP
Web Start 
File Edit View
HTTP
RMI app
File Edit View
RMI
Executable 
Jar
File Edit View
Web Start 
File Edit View
HTTP
End-users launch a Java 
Web Start app by clicking 
on a link in a Web 
page. But once the app 
downloads, it runs outside 
the browser, just like any 
other stand-alone Java 
application. In fact, a 
Java Web Start app is just 
an executable JAR that’s 
distributed over the Web.


598
 
chapter 17
How Java Web Start works
1
The client clicks on a Web page link 
to your JWS application (a .jnlp file).
The Web page link
Click 

2
The Web server (HTTP) gets the 
request and sends back a .jnlp file 
(this is NOT the JAR).
Web Server
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp MyApp.jar
click
3
Java Web Start (a small ‘helper app’ 
on the client) is started up by the 
browser. The JWS helper app reads 
the .jnlp file, and asks the server for 
the MyApp.jar file.
The .jnlp file is an XML document that 
states the name of the application’s 
executable JAR file.
click
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp MyApp.jar
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp
Web Server
JWS
Web Server
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp
“give me MyApp.jar

MyApp.jar
4
The Web server ‘serves’ up the 
requested .jar file.
JWS
Web Server
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp MyApp.jar
5
Java Web Start gets the JAR and 
starts the application by calling the 
specified main( ) method (just like an 
executable JAR).
Hello
Web Server
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp MyApp.jar
MyApp.jar
“give me MyApp.jnlp

Web browser
Java Web Start
HelloWebStart (the app in the JAR)
Next time the user wants to run this app, he can 
open the Java Web Start application and from 
there launch your app, without even being online.
Java 
Web Start


package, jars 
and
deployment
you are here
4
599
To make a Java Web Start app, you need to .jnlp (Java Network 
Launch Protocol) file that describes your application. This is the 
file the JWS app reads and uses to find your JAR and launch the 
app (by calling the JAR’s main() method). A .jnlp file is a simple 
XML document that has several different things you can put in
but as a minimum, it should look like this:
The .jnlp file
 

codebase=”http://127.0.0.1/~kathy”
href=”MyApp.jnlp”>
 
kathy App 
Wickedly Smart

Head First WebStart demo

 
 





 
The ‘codebase’ tag is where you specify the ‘root’ 
of where your web start stuff is on the server. 
We’re testing this on our localhost, so we’re using 
the local loopback address “127.0.0.1”. For web 
start apps on our internet web server, this would 
say, “http://www.wickedlysmart.com”
This is the location of the .jnlp file relative to the 
codebase. This example shows that MyApp.jnlp is 
available in the root directory of the web server, not 
nested in some other directory.
Be sure to include all of these tags, or your app might 
not work correctly! The ‘information’ tags are used by 
the JWS helper app, mostly for displaying 
when the user 
wants to relaunch a previously-downloaded application.
This means the user can run your program without 
being connected to the internet. If the user is offline, 
it means the automatic-updating feature won’t work.
This says that your app needs version 1.3 
of Java, or greater.
The name of your executable JAR! You might have 
other JAR files as well, that hold other classes or 
even sounds and images used by your app.
This is like the mainfest Main-Class entry... it says 
which class in the JAR has the main() method.



Download 40,57 Mb.

Do'stlaringiz bilan baham:
1   ...   547   548   549   550   551   552   553   554   555




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish