urlStr.append(up.getUPFile());
} else {
log.error(
"URLUtil::redirectPost() " +
"Invalid url, no tag found: " + thisUri);
throw new PortalException("Invalid URL, no tag found: " +
thisUri);
}
if (log.isDebugEnabled())
log.debug(
"URLUtil::redirectPost() " +
"Redirecting to framework: " + urlStr.toString());
OutputStreamWriter wr = null;
BufferedReader br = null;
HttpURLConnection conn = null;
try {
URL url = new URL(urlStr.toString());
conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
// forward the headers
buildHeader(req, conn);
// post the parameters
wr = new OutputStreamWriter(conn.getOutputStream(), charset);
wr.write(parameters);
wr.flush();
// now let's get the results
conn.connect(); // throws IOException
br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), charset));
StringBuffer results = new StringBuffer(512);
String oneline;
while ( (oneline = br.readLine()) != null) {
results.append(oneline).append('\n');
}
// send the results back to the original requestor
res.getWriter().print(results.toString());
} catch (IOException ioe) {
log.error(ioe, ioe);
throw new PortalException(ioe);
} finally {
try {
if (br != null)
br.close();
if (wr != null)