dfischer.femtowebserver.test
Class RedirectTestWeblet

java.lang.Object
  |
  +--dfischer.femtowebserver.test.RedirectTestWeblet
All Implemented Interfaces:
HttpdWebletInterface

public class RedirectTestWeblet
extends java.lang.Object
implements HttpdWebletInterface

This Weblet example redirects the browser to http://www.d-fischer.com .

 Sourcecode

 package dfischer.femtowebserver.test;
 import dfischer.femtowebserver.httpd.*;

 public class RedirectTestWeblet implements HttpdWebletInterface
 {
 
     public void execute(HttpRequest req, HttpResponse res, HttpdProperties httpdProperties) throws Exception
     {
         res.setAdditionalHeaderField("Location", "http://www.d-fischer.com");
         res.setStatus(302, "Found");
     }
 } 
 


Constructor Summary
RedirectTestWeblet()
           
 
Method Summary
 void execute(HttpRequest req, HttpResponse res, HttpdProperties httpdProperties)
          Executes the Weblet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RedirectTestWeblet

public RedirectTestWeblet()
Method Detail

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 data
res - HTTP response data of the Weblet
httpdProperties - properties of the Femto Web Server