Fixed issue (persistent sessions did not work anymore).
Persistent sessions did not work anymore, because the Application (which became part of the information to be serialized at some point in time) was not serializable.
This commit is contained in:
parent
e0f590da98
commit
541286dc59
2 changed files with 23 additions and 0 deletions
|
@ -568,6 +568,8 @@ public class RhinoEngine implements ScriptingEngine {
|
||||||
return new GlobalProxy((GlobalObject) obj);
|
return new GlobalProxy((GlobalObject) obj);
|
||||||
if (obj instanceof ApplicationBean)
|
if (obj instanceof ApplicationBean)
|
||||||
return new ScriptBeanProxy("app");
|
return new ScriptBeanProxy("app");
|
||||||
|
if (obj instanceof Application)
|
||||||
|
return new ApplicationProxy();
|
||||||
if (obj instanceof RequestBean)
|
if (obj instanceof RequestBean)
|
||||||
return new ScriptBeanProxy("req");
|
return new ScriptBeanProxy("req");
|
||||||
if (obj instanceof ResponseBean)
|
if (obj instanceof ResponseBean)
|
||||||
|
|
|
@ -49,9 +49,30 @@ class ScriptBeanProxy implements SerializationProxy {
|
||||||
* @return the object represented by this proxy
|
* @return the object represented by this proxy
|
||||||
*/
|
*/
|
||||||
public Object getObject(RhinoEngine engine) {
|
public Object getObject(RhinoEngine engine) {
|
||||||
return engine.global.get(name, engine.global);
|
try {
|
||||||
|
Object object = engine.global.get(name, engine.global);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return engine.global.get(name, engine.global);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serialization proxy for the application object.
|
||||||
|
*
|
||||||
|
* @author Daniel Ruthardt
|
||||||
|
* @since 20170918
|
||||||
|
*/
|
||||||
|
class ApplicationProxy implements SerializationProxy {
|
||||||
|
private static final long serialVersionUID = -3635418002212260600L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getObject(RhinoEngine engine) {
|
||||||
|
// return the application
|
||||||
|
return engine.app;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue