CS506 Assignment No. 5 Solution
Page 1 of 1 • Share
CS506 Assignment No. 5 Solution
- Code:
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class STimerOut extends HttpServlet {
// Handles the HTTP <code>GET</code> method.
// use rq to read incoming HTTP headers
// use rs to specify the HTTP response status
public void doGet(HttpServletRequest rq, HttpServletResponse rs)
throws ServletException, IOException {
// tell the browser that we are sending back html
rs.setContentType(“text/html”);
// used to modify println() statements to build a legal web page
PrintWriter out = rs.getWriter();
int t = 60;
/*
system extracts a user ID from a cookie or attached URL data, then uses
that as a key into a table of previously created HttpSession objects.
*/
HttpSession s = rq.getSession();
/*
following statements build a legal webpage
*/
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());/* getMaxInactiveInterval() gets the maximum
time in seconds for which the session remained
inactive.
out.println(“<BR>”);
out.println(“<BR>”);
s.setMaxInactiveInterval(2*t*t); /* sets the maximum time in seconds for which the
session can remain inactive.
out.println(“giving new time to get out ” +
s.getMaxInactiveInterval());
out.println(“</BODY>”);
out.println(“</HTML>”);
Rao Muhammad Aftab- Monstars
-
Posts : 1091
Join date : 2011-02-11
Age : 35
Similar topics
» CS506 Assignment No.3 Solution Spring 2013
» MGT 431 Assignment No. 1 Solution
» ENG 301 Assignment No. 1 Solution
» ENG101 Assignment No. 4 Solution
» ECO401 assignment 1 solution
» MGT 431 Assignment No. 1 Solution
» ENG 301 Assignment No. 1 Solution
» ENG101 Assignment No. 4 Solution
» ECO401 assignment 1 solution
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Sat May 04, 2024 11:49 am by ali001
» house disrepair claims
Thu May 02, 2024 4:29 pm by Ibad Khan Buledi
» Bounce n Bang: Physics puzzler
Thu May 02, 2024 11:39 am by ali001
» AIChatSY - AIChatbot Assistant
Wed May 01, 2024 10:48 am by ali001
» Storybook Magic App
Tue Apr 30, 2024 7:06 pm by ali001
» Flower Book Match3 Puzzle Game
Tue Apr 30, 2024 12:17 pm by ali001
» Avian Influenza Symptom in Chickens "Bird Flu H5N1 Virus" Vet learning materials, Poultry Farming
Sat Apr 27, 2024 9:57 am by Ibad Khan Buledi
» Aloha Planner - Note-Taker
Thu Apr 11, 2024 4:52 pm by ali001
» Streaming Guide Film TV Series
Tue Apr 09, 2024 9:39 pm by ali001