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
» ENG 301 Assignment No. 1 Solution
» MGT 431 Assignment No. 1 Solution
» HRM627 Assignment No. 2 Solution
» MGT402 Assignment No. 2 solution
» ENG 301 Assignment No. 1 Solution
» MGT 431 Assignment No. 1 Solution
» HRM627 Assignment No. 2 Solution
» MGT402 Assignment No. 2 solution
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Yesterday at 12:44 pm by ali001
» FVS Forex - Live Forex Signals
Mon May 27, 2024 9:54 am by ali001
» MedidexConnect Pharmacist Chat
Wed May 22, 2024 1:32 pm by ali001
» FISH PBs
Mon May 20, 2024 11:56 am by ali001
» Watchat Streaming World IPTV
Mon May 20, 2024 6:26 am by ali001
» Used Car Auctions USA
Sat May 18, 2024 10:16 pm by ali001
» Amuse - Become Smarter
Wed May 15, 2024 10:50 am by ali001
» Fort Lock
Sat May 04, 2024 11:49 am by ali001
» house disrepair claims
Thu May 02, 2024 4:29 pm by Ibad Khan Buledi