Sunday, 05 20th

Last update09:44:47 AM

Login With Facebook

Combinestudy

CS506 Fall 2011 4th Assignment

 

Assignment No. 04
SEMESTER Fall 2011
CS506- Web Design and Development

 

Total Marks: 15

 

Due Date: 09/01/2012

Due Date:

Your assignment must be uploaded/submitted before or on 09th January 2012.

 

Uploading instructions:

Please view the Assignment Submission Process document provided to you by the Virtual University for uploading assignments.

  • Your assignment must be in .doc format.(Any other formats like scan images, PDF, Zip, rar, bmp, docx etc will not be accepted)
  • Save your assignment with your ID (e.g. bc020200786.doc).
  • No assignment will be accepted through email.

Rules for Marking:

It should be clear that your assignment will not get any credit if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupted.
  • Your assignment is copied from internet, handouts or from any other student (Strict disciplinary action will be taken in this case).

Note:

  • Your answer must follow the below given specifications. Marks will be deducted if you do not follow these instructions.
  • Font style: “Times New Romanâ€
  • Font color: “Blackâ€
  • Font size: “12â€
  • Bold for heading only.
  • Font in Italic is not allowed at all.

 

  •    You should consult recommended books to clarify your concepts.
  •    It’s better for you to submit the assignment well before the deadline.

 

Objective

The objective of this assignment is

  1. oTo obtain your practical understanding of session management.

 

 

Marks: 15 

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>");
 
 
  }
}

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.)

 

 

Lectures Covered: This assignment covers Lecture # 29-32

Deadline

Your assignment must be uploaded/submitted at or before 09/01/2012.         

upload assignment Upload your Solution