What is the difference between a firewall and a proxy?
- The proxy works at the application level while the firewall works at the packet level.
- The proxy handles user authentication while the firewall handles packet routing.
- They are exactly the same thing.
- The proxy is uses TCP while the firewall uses UDP.
- The proxy can use encryption technologies while the firewall is limited to standard TCP/IP.
If machine jmvidal.cse.sc.edu has IP number 129.252.11.88 then
machine hadar.cse.sc.edu must have an IP number of the
form:
- *.*.*.*
- *.252.11.88
- *.*.11.88
- *.*.*.88
- 129.252.11.*
When you access the URL http://elmo:8080
you are
connecting to
- machine elmo on port 8080.
- machine elmo:8080.
- machine elmo using HTTP version 8080.
- machine elmo on port 80, but opening a secondary connection.
- machine elmo using the :8080 servlet standard protocol.
A Universal Resource Name (URN) is
- required to remain globally unique and persistent even when the resource ceases to exist or becomes unavailable.
- a short-hand description of a URL.
- a description of a resource and a protocol for locating and extracting such resource.
- not bound to the syntactic constraints of the URL but can instead represent added features of the resource in questions such as the time last modified, owner, copyright, etc.
- the name we give a URL.
MIME was originally developed for
- attaching binaries to email.
- communicating across different networks.
- perplexing passers-by.
- downloading files via FTP.
- communicating between Unix and other OSs.
The HTTP "HEAD URI" request command
- retrieves the response headers of URI.
- retrieves the last time URI was modified.
- retrieves the first x bytes (as given in a request header) of URI.
- informs the server that the client is not working.
- retrieves the contents of a URI that has moved.
Which of the following is a correct example of XHTML?
- <p>This test is <em>so unfair</em>, I'm <img width="100" height="100" alt="***" src="a.png"/>. </p>
- <p>This test is <em>so unfair, I'm <img width="100" height="100" alt="***" src="a.png"/>. </p></em>
- <>This test is <em>so unfair</em>, I'm <img width=100 height=100 alt="***" src="a.png"/>. </p>
- <p>This test is so unfair, I'm <img width="100" height="100" alt="***" src="a.png">. </p>
- <p>This test is <font style="italic">so unfair</font>, I'm ***. </p>
As a programmer you want XHTML to be used by everyone, instead
of HTML, because
- it is easy to parse.
- it incorporates programmable elements.
- it has a high compression ration.
- it implements many stylistic tags.
- it provides twice as many tags.
The root element of an XHTML document is
- html
- xhtml
- DOCTYPE
- xml
- body
Which of the following is a CSS rule (or set of rules) that says
that any link that appears within an h1 title must be red (but
not those outside), while the title is blue?
h1 {color:blue;} h1 a {color:red;}
h1 {color:blue;} {a color:red}
h1 a {color: blue; color:red;}
h1 {color:blue;} a {color: red;}
h1, a {color: blue; color:red;}
Which one of the following is not one of the units you
can use in CSS?
The separation of concerns between XHTML and CSS is one where
- XHTML describes document structure, CSS style.
- XHTML describes the tags used, CSS the content inside those tags.
- XHTML describes extensions, CSS cascades them.
- XHTML implements static elements, CSS provides dynamic elements.
- XHTML extends XML, CSS overrides XML.
The "Cascade" in CSS refers to
- the fact that multiple style sheets can be used, some of the overriding settings set by others.
- the fact that an element inherits some properties from its ancestor elements.
- the fact there are hundreds of style elements to choose from.
- the number of steps that must be followed in order to develop a successful CSS page.
- the way in which the layout boxes are placed on the page.
The CGI method does not scale well because
- a new process is created to handle each request.
- CGI programs are written using interpreted languages.
- parameter values must be passed via the URL.
- it is linked directly with the web server.
- there is no unobtrusive way to hyper-thread its namespace.
Which of the following languages is not one used to write
code that is inserted in an HTML page and executed by the web server?
- JavaScript
- Java Server Pages
- Microsoft's ASP
- PHP
Which one of the following is not a reason why you should
use Java servlets?
- Servlet API enables client-side code execution.
- Java code is portable.
- Servlet instance persists over successive invocations.
- Java language provides type safety and exception mechanism.
- Servlet is tightly integrated with server.
When writing a servlet, you must (as in, it is required that)
- implement the javax.servlet.Servlet interface.
- implement doPost().
- extend the HttpServlet class.
- customize it to the servlet server you are using.
- use multiple threads.
In terms of you program code, the communication between your
Java servlet and the client happens via
- a request and a response object.
- println() and getChar().
- getRequest() and sendResponse().
- encrypted sockets.
- a bi-directional stream object.
If I access your servlet with the URL
http://server/servlet/progname?name=buffy
, you can
get "buffy" with the command
- getParameter("name");
- getPath("/name");
- parseUrl(req).getValue("name");
- getValue();
- parseUrl(req).getPath("/name");
Why is it that in a servlet we can make the implementation of
the doPost() simply a call to the doGet()?
- Because the server packages all request information into the function's arguments.
- We cannot. They must be independently implemented.
- Because the servlet server uses introspection to pick the necessary code from the doGet() implementation.
- Because the server can tell when it should call doGet() even if the client sent in a POST request.
- Because there is no need to implement doPost() as only a few clients implement POSTing to a website.
A .war file (WAR) is
- a .jar file that must follow a particular directory structure.
- the assembly of all the .class files into a web application, along with any libraries used.
- a way to package a web application into one executable file that can be run in any computer regardless of the computer's installed software.
- a file that contains meta-information about a web application.
- a highly compressed and signed set of files.
Under the default settings, whenever a client makes a request of
a servlet
- a new thread is created.
- a new instance of that servlet is created.
- a new thread and instance of that servlet is created.
- a new server process is created.
- a new queue object is created.
A servlet server creates one instance of the servlet
- for each name that the servlet is given in the
web.xml
.
- for each request made by a client.
- and no more.
- along with one thread for its execution.
- whenever it has some free time.
If you want to support persistent connections in your servlet you need to make sure that
- the content-length header on your responses is always correctly set.
- the client is able to understand HTTP 1.1 with TLS.
- the servlet implements the SerialConnection interface.
- the servlet returns messages that are no longer than 5K.
- the servlet spawns a new thread for handling the reply.
When the servlet replies with a MOVED_TEMPORARILY or MOVED_PERMANENTLY response code
- it should also set the Location: header.
- it should throw the appropriate exception to notify the servlet server that it has moved.
- it is because the web.xml and the servlet's position in the file system do not match.
- the client will see a 404 message.
- the server will eliminate global references to the adjoining thread count.
The Cache-control HTTP response header tells us
- how long the page will remain fresh, if at all.
- whether the client should copy the downloaded page into its memory.
- the average load being experienced by the server and the implied response time delay.
- the trusted third parties that can verify the server's signature.
- the size of the look-aside buffer and is associative match length.
The reason that ServletException.getRootCause() exists is
- so that servlets can pass on an exception of any type to the server.
- to allow a servlet to diagnose the underlying cause of an exception it caught while sending data back to the client.
- because Java lacks multiple inheritance.
- to allow the server to run multiple instances of the servlet even if some of them crash.
- to provide a distributed mechanism for session activation.
If while your servlet is writing its response to the user the
user presses the stop button, what happens?
- The servlet will have to handle an IOException.
- The servlet will not notice, but the data will never reach the client.
- The client sends a special header to the server which informs him that the connection has been closed.
- The server will kill the thread that is handling that request.
- The servlet will not notice, but the servlet instance will be destroyed after it is done with the reply.
What is the job of a WAP gateway?
- To translate between WTP and HTTP.
- To relay HTTP packets to the appropriate wireless network.
- To mask the identity and location of the wireless client.
- To transform the content between HTML and WML.
- To provide NAT services.
In WML every page consists of
- a set of cards.
- a strict subset of HTML 4.0.
- a list of items that the client might be interested in viewing.
- a head, a body, and a footer.
- a telephone number, plan identification, and connection speed.
If you wanted to write a servlet that generates dynamic images
then you would need to use Java's standard API for drawing along
with
- the appropriate encoder.
- the Swing API.
- the Servlet User Interface extension API.
- a library for drawing web images.
- a server modification that allows the serving of such images.
Which one of the following is not a method for
implementing session tracking in HTTP?
- Pass userid in HTTP request header.
- Pass userid in URL parameter.
- Use HTTP authentication.
- Pass userid in hidden form fields.
- Pass userid in cookie.
If you want to make everyone who visits your website and, later
on, visits microsoft.com to give their server the string
"Resistance is Futile", what can you do?
- Given them a cookie that says "Resistance is Futile" and set its path to microsoft.com.
- Change all the outside-pointing URLs in your website point to microsoft.com/Resistance_is_Futile.
- Return a Location: header with value of microsoft.com along with an HTML page that says "Resistance is Futile".
- Enable port-forwarding in your server and include the string "Resistance is Futile" in every request.
- Add the string "&msg=Resistance-is-Futile" to the end of all your URLs.
Java servlets provide a session tracking API which allows you to do many things. Which one of the following things is not something that the API allows you to do.
- Get the name of the user.
- Attach any Java Object to the session.
- Determine how long ago the client last accessed the server (within limits).
- Determine when the client first connected to the server (within limits).
- Cont the number of pages a client accesses on your website.
What is the added feature that HTTP digest authentication offers over basic authentication?
- Passwords are sent in encrypted form.
- Allows users to have multiple roles.
- Observes the difference between username and password.
- Uses public key encryption algorithms.
- Allows multiple users to authenticate at the same time.
What is an advantage that form-based HTTP authentication has over regular authentication.
- It provides a friendly user interface.
- It is faster.
- It encrypts the user's password.
- It enables one to require multiple passwords.
- It uses public key encryption.
In the Secure Socket Layer (SSL) protocol the two parties involved
- use public key encryption to authenticate and then encrypt the communication using a symmetric key.
- use public key encryption to encrypt the whole communication.
- use their private keys to encrypt the whole communication and authenticate with Verisign (or some other authority).
- use symmetric key encryption to MD5 their identities and then MD5 the communication.
- use HTTP1.1, cookies, and Verisign in order to authenticate each other and encrypt the communication.
If you want to write a servlet that will be distributable (that is, deployed in a J2EE with load distribution). Which one of the following is something that you must do?
- Ensure that any object placed in the session is serializable.
- Ensure that the servlet has no class variables.
- Ensure that the doGet() method call reDistribute() before returning.
- Ensure that the servlet uses TLS.
- Ensure that all parameters passed in the URL are UTF-8.
A big difference between Java Server Pages (JSP) and JavaScript is that
- JSP code gets executed in the server while JavaScript is executed at the client.
- JSP is used for mostly static web pages while JavaScript is used for dynamic web pages.
- JSP has nothing to do with Java while JavaScript is a subset of the Java language.
- JSP is used along with a servlet server while JavaScript cannot be used within a servlet server.
- JSP is more powerful than JavaScript.
If you wanted to share some piece of information among two
different servlets on the same servlet engine, which one of the
following could you use?
- The ServletContext.
- A member variable.
- The web.xml file.
- The ServletSocket.
- The ServerSharedVariables.