BBjspSessionData::getLastAccessedTime (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.

Description

In BBj 16.0 and higher, this method returns a long containing the number of milliseconds since midnight January 1, 1970 GMT that this BBjspSession was accessed.

Syntax

Return Value

Method

long

getLastAccessedTime()

Parameters

None.

Return Value

number of milliseconds since midnight January 1, 1970 GMT

Remarks

Example

This example demonstrates how this works in a BBJSP servlet

USE java.text.SimpleDateFormat
USE java.util.Date
USE java.util.GregorianCalendar

CLASS PUBLIC MyServlet

    REM ===
    REM === You must implement this method as it is the main execution point.
    REM ===
    METHOD PUBLIC void service(BBjspServletContext context!)
        
        declare BBjspWebRequest request!
        declare BBjspWebResponse response!
        declare BBjspSessionData data!
        
        request! = context!.getRequest()
        response! = context!.getResponse()
        data! = #context!.getBBjspSession()
        
        declare GregorianCalendar calendar!
        declare SimpleDateFormat sdf!
        
        sdf! = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss.SSS")
        
        calendar! = new GregorianCalendar()
        calendar!.setTimeInMillis(data!.getLastAccessedTime())
    
        s! = response!.getOutputStream()
        s!.write("<html>")
        s!.write("<body>")
        s!.write("<html><body><h1>Hello from BBJSP</h1>")
        s!.write(sdf!.format(calendar!.getTime()))
        s!.write("</body>")
        s!.write("</html>")
        
    METHODEND
    
CLASSEND

See Also

BBJSP