Servlet Development Guide : PART III Programming : Chapter 9 Creating Servlets : Designing the Servlet Class
Designing the Servlet Class
The servlet responds to both HTTP GET and HTTP POST requests. Therefore, the servlet derives from rwsf::HttpServlet and overrides the doGet() and doPost() functions of rwsf::HttpServlet. The header for the SessionExample servlet follows:
 
// SessionExample.h
 
#include <rwsf/servlet/http/HttpServlet.h>
#include <rwsf/servlet/http/HttpServletRequest.h>
#include <rwsf/servlet/http/HttpServletResponse.h>
 
class SessionExample : public rwsf::HttpServlet {
 
public:
 
virtual void doGet(rwsf::HttpServletRequest& request,
rwsf::HttpServletResponse& response);
 
virtual void doPost(rwsf::HttpServletRequest& request,
rwsf::HttpServletResponse& response);
 
};