Skip to content

Commit

Permalink
ZK-5150: uploading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
DevChu committed May 27, 2022
1 parent 59a5da6 commit 92a29aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions zk/src/org/zkoss/zk/au/http/AuDropUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
}

final Map<String, String> attrs = new HashMap<String, String>();
String alert = null, uuid = null, dtid = null, nextURI = null;
String alert = null, uuid = null, dtid = null;
Desktop desktop = null;
try {
if (Strings.isEmpty(uuid = fetchParameter(request, "uuid", attrs)))
Expand All @@ -110,7 +110,6 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
if (alert == null) {
desktop = ((WebAppCtrl) sess.getWebApp()).getDesktopCache(sess).getDesktop(dtid);
final Map<String, Object> params = parseRequest(request, desktop, "");
nextURI = (String) params.get("nextURI");
processItems(desktop, params, attrs);
}
} catch (Throwable ex) {
Expand All @@ -120,8 +119,6 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
if (uuid != null)
attrs.put("uuid", uuid);
}
if (nextURI == null)
nextURI = request.getParameter("nextURI");

if (ex instanceof ComponentNotFoundException) {
alert = generateAlertMessage(MISSING_REQUIRED_COMPONENT, Messages.get(MZk.UPDATE_OBSOLETE_PAGE, uuid));
Expand Down
9 changes: 2 additions & 7 deletions zk/src/org/zkoss/zk/au/http/AuUploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
}

final Map<String, String> attrs = new HashMap<String, String>();
String alert = null, uuid = null, nextURI = null, sid = null;
String alert = null, uuid = null, sid = null;
Desktop desktop = null;
try {
if (!isMultipartContent(request)) {
Expand Down Expand Up @@ -162,7 +162,6 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
} else {
desktop = ((WebAppCtrl) sess.getWebApp()).getDesktopCache(sess).getDesktop(dtid);
final Map<String, Object> params = parseRequest(request, desktop, uuid + '_' + sid);
nextURI = (String) params.get("nextURI");

processItems(desktop, params, attrs);
}
Expand All @@ -174,8 +173,6 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
if (uuid != null)
attrs.put("uuid", uuid);
}
if (nextURI == null)
nextURI = request.getParameter("nextURI");

if (ex instanceof ComponentNotFoundException) {
alert = generateAlertMessage(MISSING_REQUIRED_COMPONENT, Messages.get(MZk.UPDATE_OBSOLETE_PAGE, uuid));
Expand Down Expand Up @@ -213,9 +210,7 @@ public void service(HttpServletRequest request, HttpServletResponse response, St
if (log.isTraceEnabled())
log.trace(Objects.toString(attrs));

if (nextURI == null || nextURI.length() == 0)
nextURI = "~./zul/html/fileupload-done.html.dsp";
Servlets.forward(_ctx, request, response, nextURI, attrs, Servlets.PASS_THRU_ATTR);
Servlets.forward(_ctx, request, response, "~./zul/html/fileupload-done.html.dsp", attrs, Servlets.PASS_THRU_ATTR);
}

/** Handles the exception that was thrown when uploading files,
Expand Down
1 change: 1 addition & 0 deletions zkdoc/release-note
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ZK 9.5.1.4
* Features

* Bugs
ZK-5150: uploading issue

* Upgrade Notes

Expand Down

0 comments on commit 92a29aa

Please sign in to comment.