[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    I would like to add request / session info to the
From:       "James Carroll" <jcarroll () microbrightfield ! com>
Date:       2002-02-07 16:04:12
[Download RAW message or body]


Hi thanks for the work on the helma (apache) xmlrpc library!

I am wondering if it's possible to somehow add request info
(like the session stuff) from the XmlRpcServlet so that it is available 
to the function being called by xmlrpc.

For instance: I added the lines with the ***

public class XmlRpcServlet {
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException  
    {
     *** xmlrpc.setServletRequest(req)
        byte[] result = xmlrpc.execute(req.getInputStream ());
        res.setContentType("text/xml");
        res.setContentLength(result.length);
        OutputStream output = res.getOutputStream();
        output.write(result);
        output.flush();
    }
}

public class Test {

    XmlRpcServer itsServer;

    public String hello()
    {
       *** // somehow get the servlet request information
       *** ses = itsServer.getServletRequestForThisSpecificXMLRPC_Call()
       *** // get a session variable
	 *** Long uid = (Long)session.getAttribute("uid");

        return new String("Hello from Neuroinfo. Rodger, copy.");
    }
}

Thanks!
-Jim Carroll
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic