private Object makedata(Session sess) {
try {
try {
- return(dcl.getConstructor().newInstance());
+ return(dcl.getConstructor(Session.class).newInstance(sess));
} catch(NoSuchMethodException e) {
}
try {
- return(dcl.getConstructor(Session.class).newInstance(sess));
+ return(dcl.getConstructor().newInstance());
} catch(NoSuchMethodException e) {
}
} catch(InstantiationException e) {
if(resp == null) {
resp = create(sess);
sess.put(rcl, resp);
+ if(resp instanceof ContextResponder) {
+ final ContextResponder cr = (ContextResponder)resp;
+ sess.listen(new Session.Listener() {
+ public void expire(Session sess) {
+ cr.destroy();
+ }
+ });
+ }
}
}
resp.respond(req);