FileDocCategorySizeDatePackage
RequestBinder.javaAPI DocExample723Sun May 25 18:20:56 BST 2003com.jspservletcookbook

RequestBinder

public class RequestBinder extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

    
    //bind an object to the servlet context
    ContextObject contextObj = new ContextObject();
    contextObj.put( request.getRemoteAddr(), ""+new java.util.Date());
    request.setAttribute(
        "com.jspservletcookbook.RequestObject",contextObj );
    
    //better display something
    RequestDispatcher dispatcher = request.getRequestDispatcher("/displayAttr");
    dispatcher.forward(request,response);