0% found this document useful (0 votes)
11 views1 page

Web Technology Assignment: JavaScript & JSP

The document discusses four questions about JavaScript and web technologies. Question 1 asks about obfuscated JavaScript code that calls an alert method. Question 2 asks about session IDs in HTTP responses for rewritten URLs. Question 3 provides instructions for a JSP error page that displays an exception message. Question 4 asks about the output of a JavaScript program that declares and assigns variables both locally and globally.

Uploaded by

Harsha Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Web Technology Assignment: JavaScript & JSP

The document discusses four questions about JavaScript and web technologies. Question 1 asks about obfuscated JavaScript code that calls an alert method. Question 2 asks about session IDs in HTTP responses for rewritten URLs. Question 3 provides instructions for a JSP error page that displays an exception message. Question 4 asks about the output of a JavaScript program that declares and assigns variables both locally and globally.

Uploaded by

Harsha Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ASSIGNMENT-2

Paper code: ETCS-308


Subject: Web Technology

Q1. JavaScript code used by a Web document must be in a file that can be read by
anyone who can access the document. In an attempt to keep others from using
their code, some JavaScript authors obfuscate their code—that is, attempt to
reduce the intelligibility of their code—in various ways. What does the following
obfuscate code do, and why?
var weird = "al" + "father".slice(4, 6) + "t";
window[weird]("Weird, but it works.");

Q2. A new visitor sends a request to the URL of a servlet that uses URL rewriting. Do
you think that the servlet response will contain the session ID in the HTTP header,
in URLs written to the body of the response, in neither, or in both? Justify your
answer. How could you test your hypothesis?

Q3. Write a complete JSP document that could be used as an error page. In particular,
this document should call the getMessage() method of the exception represented
by the implicit object exception and display the String returned by the method in an
XHTML document. Do not use scriptlet code within your document.

Q4. What is output, if the following JavaScript program is executed by a typical web
browser? Explain.
var i=5;
function duh()
{
var i;
window.i=6;
}
duh();
[Link](i);

You might also like