If I understand you correctly, you're calling the addrequesthandler method on Core, which doesn't take servlets as a method parameter but "RequestHandler"s. These are a mendix-specific emulation of servlets, but don't actually support any of the methods that servlets themselves support.
Anyway, proceeding from there, I'm assuming all the classes you mentioned aren't servlets but instead RequestHandlers. This makes it a bit interesting, because that means that you're working in the "m2ee context" instead of the "j2ee context", if you understand what I mean. In the mx runtime, we work with ISession objects instead of http session objects. every RequestHandler inherits from the base abstract class "RequestHandler", which has a method
This in return gives you an ISession object, which has a UUID that can be used to uniquely identify the session. (an alternative to identify requests is getContext().getRequestId(), but that won't help you if you want to identify sessions as opposed to requests)
So, one option you could go for is implementing your own sessionmanager (some type of singleton) and registering objects there, under the session UUID.
(On a side note: it's really cool to see people using these APIs. Although this is the way we planned it, it's kinda techy stuff that normal business users might find a bit too complicated. We're open for suggestions on how to expand this API (such as being able to register parameters or whatever in the ISession object) so hit us up with some feature requests in MXDN)
You can write your own servlets and attach them to the webserver using
Core.addRequestHandler("yoursuburl/", new YourHandlerClass());
If you implement this handler class you should be able to access any property of the Request/ Response objects which are passed to the servlet.
The problem is solved. I've extended the JasperReports component and have overwritten the related functions to make the j2ee-troublemakers Mendix-compatible. That means: Replacing everything related to BaseHttpServlet etc. with global objects and add getters/setters to modify the properties.