07-03-2011, 01:01 AM
Question:
Analyze following code and comment it accordingly showing each code segment impact in the Servlet. After doing so with code write down the purpose of this code in no more than 3-4 sentences. This assignment is based on negative marking if any unnecessary information or too much detail is provided your marks will be deducted.
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class STimerOut extends HttpServlet {
public void doGet(HttpServletRequest rq, HttpServletResponse rs)
throws ServletException, IOException {
rs.setContentType("text/html");
PrintWriter out = rs.getWriter();
int t = 60;
HttpSession s = rq.getSession();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE >");
out.println("Session TimeOut ");
out.println("</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("<H1>");
out.println("Session TimeOut ");
out.println("</H1>");
out.println("gaining the old time out " +
s.getMaxInactiveInterval());
out.println("<BR>");
out.println("<BR>");
s.setMaxInactiveInterval(2*t*t);
out.println("giving new time to get out " +
s.getMaxInactiveInterval());
out.println("</BODY>");
out.println("</HTML>");
}
}
Note: Your answer should be in your own words and it should be concise and precise. (This means there can’t be multiple copies of your solution, if found will be treated as copy case.)
Analyze following code and comment it accordingly showing each code segment impact in the Servlet. After doing so with code write down the purpose of this code in no more than 3-4 sentences. This assignment is based on negative marking if any unnecessary information or too much detail is provided your marks will be deducted.
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class STimerOut extends HttpServlet {
public void doGet(HttpServletRequest rq, HttpServletResponse rs)
throws ServletException, IOException {
rs.setContentType("text/html");
PrintWriter out = rs.getWriter();
int t = 60;
HttpSession s = rq.getSession();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE >");
out.println("Session TimeOut ");
out.println("</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("<H1>");
out.println("Session TimeOut ");
out.println("</H1>");
out.println("gaining the old time out " +
s.getMaxInactiveInterval());
out.println("<BR>");
out.println("<BR>");
s.setMaxInactiveInterval(2*t*t);
out.println("giving new time to get out " +
s.getMaxInactiveInterval());
out.println("</BODY>");
out.println("</HTML>");
}
}
Note: Your answer should be in your own words and it should be concise and precise. (This means there can’t be multiple copies of your solution, if found will be treated as copy case.)
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
