Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.3
-
Fix Version/s: 1.6.1
-
Component/s: None
-
Labels:None
-
Environment:Operating System: Windows XP
Platform: PC
-
Workaround Exists:Yes
-
Workaround Description:
Description
In FileUploadServlet.java the execute() method doesn't pass the RESTORE_VIEW phase because the VIEW_STATE_PARAM parameter required by GlassFish JSF 1.2 implementation to think it's a postBack, is not encoded in FileUploadServlet.
There should have been a similar code in FileUploadServlet.java like in BlockingServlet.java where you have:
BlockingServlet.java:
static {
//We will place VIEW_STATE_PARAM in the requestMap so that
//JSF 1.2 doesn't think the request is a postback and skip
//execution
try {
Field field = javax.faces.render.ResponseStateManager.class.getField("VIEW_STATE_PARAM");
if (null != field) {
postBackKey = (String) field.get(javax.faces.render.ResponseStateManager.class);
}
} catch (Exception e) {
}
}
....
void renderCycle(BridgeFacesContext context, Lifecycle lifecycle) {
synchronized (context) {
context.setCurrentInstance();
DOMResponseWriter.applyBrowserDOMChanges(context);
//Here is where the key is being set into the external context
if (null != postBackKey) {
context.getExternalContext().getRequestParameterMap()
.put(postBackKey, "not reload");
}
lifecycle.execute(context);
lifecycle.render(context);
context.release();
}
}
There should have been a similar code in FileUploadServlet.java like in BlockingServlet.java where you have:
BlockingServlet.java:
static {
//We will place VIEW_STATE_PARAM in the requestMap so that
//JSF 1.2 doesn't think the request is a postback and skip
//execution
try {
Field field = javax.faces.render.ResponseStateManager.class.getField("VIEW_STATE_PARAM");
if (null != field) {
postBackKey = (String) field.get(javax.faces.render.ResponseStateManager.class);
}
} catch (Exception e) {
}
}
....
void renderCycle(BridgeFacesContext context, Lifecycle lifecycle) {
synchronized (context) {
context.setCurrentInstance();
DOMResponseWriter.applyBrowserDOMChanges(context);
//Here is where the key is being set into the external context
if (null != postBackKey) {
context.getExternalContext().getRequestParameterMap()
.put(postBackKey, "not reload");
}
lifecycle.execute(context);
lifecycle.render(context);
context.release();
}
}
Please verify that inputFile is working correctly with Glassfish v2 for 1.6.2.