Vous êtes sur la page 1sur 4

SERVLET:

Fill in the blanks in each of the following statements:


Classes HttpServlet and GenericServlet implement the__________interface.
Class HttpServlet defines the methods__________and__________to respond to get and
post requests from a client.
HttpServletResponse method__________obtains a character-based output stream that
enables text data to be sent to the client.
The form attribute__________specifies the server-side form handler , i.e., the program
that handles the request.
__________is the well-known host name that refers to your own computer.
State whether each of the following is true or false. If false, explain why.
Servlets usually are used on the client side of a networking application.
Servlet methods are executed by the servlet container.
The two most common HTTP requests are get and put.
The well-known port number on a Web server where requests for HTML documents
are made is 8080.

JSP
Fill in the blanks in each of the following statements:
Action __________ has the ability to match request parameters to properties of the
same name in a bean by specifying "*" for attribute property.
There are four key components to JSPs: __________, __________, __________ and
__________.
The implicit objects have four scopes: __________, __________, __________ and.
__________
The __________ directive is processed once at JSP translation time and causes
content to be copied into the JSP.
Classes and interfaces specific to JavaServer Pages programming are located in
packages __________ and __________ .

[Page 1325]
JSPs normally execute as part of a Web server that is referred to as the __________ .
JSP scripting components include __________, __________, __________, __________ and
__________ .
State whether each of the following is true or false. If false, explain why.
An object with page scope exists in every JSP of a particular Web application.
Directives specify global information that is not associated with a particular JSP
request.
Action <jsp:include> is evaluated once at page translation time.
Like XHTML comments, JSP comments and script-language comments appear in the
response to the client.
Objects with application scope are part of a particular Web application.
Each page has its own instances of the page-scope implicit objects.
Action <jsp:setProperty> has the ability to match request parameters to properties
of the same name in a bean by specifying "*" for attribute property.
Objects with session scope exist for the client's entire browsing session.
ALL:

1. Memanggil servlet dilakukan dengan :


(1). menyimpan alamatnya di atribut action tag form HTML
(2). alamatnya dituliskan dengan : http://alamatHost/namaservlet
2. Class Java yang akan dijadikan sebagai Servlet perlu meng-extends class:
(1). HttpServlet
(2). UnicastRemoteObject
3. Sintaks Java di JSP diawali dan diakhiri dengan tanda :
(1). <? ?>
(2). <% %>
4. Program Servlet dikompilasi :
(1). sebelum dideploy
(2). setelah dideploy
5. Program JSP dikompilasi :
(1). sebelum dideploy
(2). setelah dideploy

6. Untuk menggambarkan web service digunakan WSDL. WSDL singkatan dari :


(1). Web Service Description Language
(2). Web Service Describe Language.
7. Method yang disiapkan untuk web service di Java lebih mudah dibuat dalam format :
(1). RMI
(2). Corba
.
8. Client yang mengakses Web Service dapat dalam bentuk :
(1). HTML + Servlet atau JSP
(2). Aplikasi Desktop
9. Pengiriman data call procedure maupun hasil eksekusinya pada web service
menggunakan format :
(1). HTML
(2). XML.

SERVLET - ANS
a) Servlet. b) doGet, doPost. c) getWriter. d) action. e) localhost.
False. Servlets are usually used on the server side.
True.
False. The two most common HTTP request types are get and post. The put request
type is often not allowed for security reasons.
False. The well-known port number on a Web server where requests for HTML
documents are made is 80. Port 8080 is the Tomcat servlet container's default port.

JSP ANS
a) <jsp:setProperty>. b) directives, actions, scripting elements, tag libraries. c)
application, page, request, session. d) include. e) javax.servlet.jsp,
javax.servlet.jsp.tagext. f) JSP container. g) scriptlets, comments, expressions,
declarations, escape sequences.
a) False. Objects with page scope exist only as part of the page in which they are
used. b) True. c) False. Action <jsp:include> enables dynamic content to be included
in a JavaServer Page. d) False. JSP comments and script-language comments are
ignored and do not appear in the response. e) False. Objects with application scope
are part of the JSP container application. f) True. g) True. h) True.

QUIZ 02
Nama

NIM

Isian Singkat.
1. Kelas HttpServlet dan GenericServlet meng-implement interface __________.
2. Kelas HttpServlet mendefinisikan dua method yaitu __________dan
__________untuk merespon request get dan post dari sebuah client.
3. Method dari HttpServletResponse __________ menerima sebuah outputstream
berbasis character yang memungkinkan data teks untuk dikirim ke client.
4. Dalam JSP, Action __________ mempunyai kemampuan untuk mengambil nilai
dari sebuah atribut property dari sebuah bean sesuai dengan mengisi
parameter dengan nama atribut tersebut.
5. Terdapat 4 komponen utama dalam JSP : __________, __________, __________ dan
__________.
6. Implicit objects mempunyai 4 scope yaitu : __________, __________, __________
dan. __________
Web Service.
JIka terdapat class Pegawai.java
public class Pegawai {
public String nama = Joko;
public int golongan = 4;
private float gaji = 5000;
public float getUpah(){
return this.gaji;
}
}
Jika pada sebuah operation pada web service mempunyai return value
berupa class Pegawai tersebut. Bagaimanakah format pesan SOAP response
yang dikirim ke client?