dfischer.femtowebserver.test
Class CurrentTimeTestSssi
java.lang.Object
|
+--dfischer.femtowebserver.test.CurrentTimeTestSssi
- All Implemented Interfaces:
- HttpdSssiInterface
- public class CurrentTimeTestSssi
- extends java.lang.Object
- implements HttpdSssiInterface
This SSSI example displays the current time, based on a specific time zone.
Java Sourcecode
package dfischer.femtowebserver.test;
import dfischer.femtowebserver.httpd.*;
import dfischer.femtowebserver.lib.ZoneTime;
public class CurrentTimeTestSssi implements HttpdSssiInterface
{
public String execute(String[] args, HttpRequest httpRequest, HttpdProperties httpdProperties) throws Exception
{
String timeZoneId = "GMT";
if (args.length > 0)
timeZoneId = args[0].trim().toUpperCase();
return ZoneTime.dateToShortString(timeZoneId, false) + " (" + timeZoneId + ")";
}
}
HTML Source
<HTML>
<BODY>
Current Time = <!-- @dfischer.femtowebserver.test.CurrentTimeTestSssi("ECT") -->
</BODY>
</HTML>
- See Also:
ZoneTime.TIME_ZONE,
HttpdSssiInterface
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CurrentTimeTestSssi
public CurrentTimeTestSssi()
execute
public java.lang.String execute(java.lang.String[] args,
HttpRequest httpRequest,
HttpdProperties httpdProperties)
throws java.lang.Exception
- Executes the SSSI.
- Specified by:
execute in interface HttpdSssiInterface
- Parameters:
args - arguments from the HTML/SSSI call. If args[0] is given, it's the desired time zonehttpRequest - HTTP request datahttpdProperties - properties of the Femto Web Server