NIHVIVO-161 - Bug fix: on exit, distinguish between relative URLs and absolute URLs.
This commit is contained in:
parent
f4d219637a
commit
ff85d8f91c
1 changed files with 8 additions and 1 deletions
|
@ -200,7 +200,14 @@ public class ImageUploadController extends FreeMarkerHttpServlet {
|
|||
*/
|
||||
private void doForward(HttpServletRequest req, HttpServletResponse resp,
|
||||
ResponseValues values) throws ServletException, IOException {
|
||||
req.getRequestDispatcher(values.getForwardUrl()).forward(req, resp);
|
||||
String forwardUrl = values.getForwardUrl();
|
||||
if (forwardUrl.contains("://")) {
|
||||
// It's a full URL, so redirect.
|
||||
resp.sendRedirect(forwardUrl);
|
||||
} else {
|
||||
// It's a relative URL, so forward within the application.
|
||||
req.getRequestDispatcher(forwardUrl).forward(req, resp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue