— Scott McNealy, Sun Microsystems Chairman, President and ceo



Download 40,57 Mb.
Pdf ko'rish
bet554/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)

600
 
chapter 17
Steps for making and deploying 
a Java Web Start app
1
Make an executable JAR 
for your application.
MyApp.jar
2
Write a .jnlp file.
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
MyApp.jnlp
3
Web Server
MyApp.jar
Lorper 
iure 
eugue 
tat vero 
conse 
euguero-
roo.html
Lorper 
<
iure 
eugue 
tat vero 
conse 
MyApp.jnlp
Place your JAR and .jnlp 
files on your Web server.
4
Add a new mime type to your Web server.
This causes the server to send the .jnlp file with the 
correct header, so that when the browser receives 
the .jnlp file it knows what it is and knows to start 
the JWS helper app. 
application/x-java-jnlp-file
Web Server
configure 
mime type
5
Create a Web page with a link 
to your .jnlp file


Launch My Application 

Java 
rules!


“here’s a confi rmation page”
100% Local Combination 100% Remote
Servlets
HTTP
Web Start 
File Edit View
HTTP
RMI app
File Edit View
RMI
Executable 
Jar
File Edit View
Servlets
HTTP
Servlets
HTTP


626
 
chapter 18
very simple 
servlet
Step for making and running a servlet
1
Find out where your servlets need to be placed.
For these examples, we’ll assume that you already have a web server 
up and running, and that it’s already confi gured to support servlets. 
The most important thing is to fi nd out exactly where your servlet 
class fi les have to be placed in order for your server to ‘see’ them. If 
you have a web site hosted by an ISP, the hosting service can tell you 
where to put your servlets, just as they’ll tell you where to place your 
CGI scripts. 
101101 
10 110 1 
0 11 0 
001 10 
001 01 
MyServletA.class
Web Server 
Servlets
2
Get the servlets.jar and add it to your classpath
Servlets aren’t part of the standard Java libraries; you need 
the servlets classes packaged into the servlets.jar fi le. You can 
download the servlets classes from java.sun.com, or you can get 
them from your Java-enabled web server (like Apache Tomcat, at 
the apache.org site). Without these classes, you won’t be able to 
compile your servlets.
3
Write a servlet class by extending HttpServlet
A servlet is just a Java class that extends HttpServlet (from the 
javax.servlet.http package). There are other types of servlets you 
can make, but most of the time we care only about HttpServlet. 
public class MyServletA extends HttpServlet { ... }
servlets.jar
4
Write an HTML page that invokes your servlet
When the user clicks a link that references your servlet, the web 
server will fi nd the servlet and invoke the appropriate method 
depending on the HTTP command (GET, POST, etc.)

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