=== modified file 'src/com/goldencode/p2j/main/WebHandler.java' --- src/com/goldencode/p2j/main/WebHandler.java 2015-05-18 20:48:28 +0000 +++ src/com/goldencode/p2j/main/WebHandler.java 2016-01-28 12:36:53 +0000 @@ -19,18 +19,22 @@ ** 007 OM 20150108 Passed null map as additional environment to WebClientSpawner.spawn(). ** 008 GES 20150127 Cleanup code formatting. ** 009 GES 20150311 Modified this to support both chui and gui web clients. +** 010 SBI 20160128 Changed the redirect HTTP response to the "text/html" response containing +** the redirect path in its body. */ package com.goldencode.p2j.main; import java.io.*; import java.util.logging.*; + import javax.servlet.*; import javax.servlet.http.*; + import org.eclipse.jetty.http.*; import org.eclipse.jetty.server.*; import org.eclipse.jetty.server.handler.*; -import com.goldencode.p2j.ui.client.chui.driver.web.*; + import com.goldencode.p2j.util.*; import com.goldencode.util.PlatformHelper; @@ -228,7 +232,7 @@ } } - response.sendRedirect(remoteUri); + sendRedirectPath(remoteUri, base, request, response); } else { @@ -244,6 +248,51 @@ } /** + * Sends the redirect to the main application site that requires users to be authorized. + * + * @param remoteUri + * The redirect url provided with the authorization parameter. + * @param base + * The base request. + * @param request + * The http request. + * @param response + * The http response. + */ + private void sendRedirectPath( + String remoteUri, + Request base, + HttpServletRequest request, + HttpServletResponse response) + { + response.setContentType(MimeTypes.Type.TEXT_HTML.asString()); + response.setStatus(HttpServletResponse.SC_OK); + response.setHeader(HttpHeader.CACHE_CONTROL.asString(), + "no-cache, no-store, must-revalidate"); + response.setDateHeader(HttpHeader.EXPIRES.asString(), 0); + + try + { + PrintWriter writer = response.getWriter(); + writer.println(remoteUri); + writer.flush(); + } + catch (IOException ioe) + { + LOG.logp(Level.SEVERE, + "WebHandler.sendRedirectPath()", + "", + LogHelper.generate("IOException!"), + ioe); + } + finally + { + // mark the request as handled + base.setHandled(true); + } + } + + /** * Process the given string and make any replacements of parameter * values as needed. The replacement placeholder follow the JEE * expression language (EL) format for immediate evaluation. === modified file 'src/com/goldencode/p2j/main/web_client.html' --- src/com/goldencode/p2j/main/web_client.html 2015-05-18 20:48:28 +0000 +++ src/com/goldencode/p2j/main/web_client.html 2016-01-28 12:32:29 +0000 @@ -2,11 +2,94 @@ Operating System Login (P2J ${client_ui_type} Web Client) - + +
-
+ @@ -21,6 +104,7 @@
${error}
- + + \ No newline at end of file
User Name: