dfischer.femtowebserver.test
Class DivisionByNullTestWeblet
java.lang.Object
|
+--dfischer.femtowebserver.test.DivisionByNullTestWeblet
- All Implemented Interfaces:
- HttpdWebletInterface
- public class DivisionByNullTestWeblet
- extends java.lang.Object
- implements HttpdWebletInterface
This Weblet example shows what happens, when a java Exception occurs during the execution of the Weblet.
The Femto Web Server response is "500 Internal Server Error".
Sourcecode
package dfischer.femtowebserver.test;
import dfischer.femtowebserver.httpd.*;
public class DivisionByNullTestWeblet implements HttpdWebletInterface
{
public void execute(HttpRequest req, HttpResponse res, HttpdProperties httpdProperties) throws Exception
{
int a = 2;
int b = 0;
int result = a / b; // division by null
res.println("You will never see the result " + result);
}
}
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DivisionByNullTestWeblet
public DivisionByNullTestWeblet()
execute
public void execute(HttpRequest req,
HttpResponse res,
HttpdProperties httpdProperties)
throws java.lang.Exception
- Executes the Weblet.
- Specified by:
execute in interface HttpdWebletInterface
- Parameters:
req - HTTP request datares - HTTP response data of the WeblethttpdProperties - properties of the Femto Web Server