Question:
Analyze following code using your best effort. And then give and explain its output. Yours explanation should not exceed 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("<BODY>");
out.println("<H3>");
out.println(" Making Session based checkOut ");
out.println("</H3>");
out.println("obtain previous time out " +
s.getMaxInactiveInterval());
out.println("<BR>");
out.println("<BR>");
s.setMaxInactiveInterval(2*t*t); // two hours
out.println("setting new time to get out " +
s.getMaxInactiveInterval());
out.println("</BODY>");
out.println("</HTML>");
}}
Iss pooray code say jo hoga wo bata deta hoon
ReplyDeleteScreen per 3 lines print hon gi
First line ........ Making session based
checkout
and 2nd line ....... Obtain previous timeout
aur iss kay end per purana timeout interval likha hoga
iss kay baad time out interval 2 hours per set ho jaay ga
phir 3rd line print hogi ............ Setting new time to get out
solution by shahid bhai,,,, at main page,,,,baki khud hal kain plz,,,
Read more: CS506 Assignment No 4 Solution & Discussion Fall 2011 - Virtual University of Pakistan http://vustudents.ning.com/group/cs506webdesignanddevelopment/forum/topics/cs506-assignment-no-4-solution-discussion-fall-2011#ixzz1j3DmlOxF