04-17-2013 01:09 AM
04-18-2013 03:04 AM
<%
URL url1 = new URL("http://localhost:8080/share/page");
HttpURLConnection conn = (HttpURLConnection) url1.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("SsoUserHeader", "admin");
for (int i = 0;; i++) {
String headerName = conn.getHeaderFieldKey(i);
String headerValue = conn.getHeaderField(i);
System.out.println(headerName + "===");
System.out.println(headerValue);
if (headerName == null && headerValue == null) { break; }
}
String sessionValue = conn.getHeaderField("Set-Cookie").substring(0,conn.getHeaderField("Set-Cookie").indexOf(";"));
conn.setRequestProperty("Set-Cookie", sessionValue);
conn.connect();
BufferedReader dis = new BufferedReader(
new InputStreamReader(
conn.getInputStream()));
String myString;
while ((myString = dis.readLine()) != null)
{
System.out.println(myString);
}
conn.setInstanceFollowRedirects(false);
int responseCode = conn.getResponseCode();
System.out.println( responseCode );
String location = conn.getHeaderField( "Location" );
System.out.println( location );
String urlstring = conn.getHeaderField("Location");
response.sendRedirect(urlstring);
%>
null===
HTTP/1.1 302 Found
Server===
Apache-Coyote/1.1
Set-Cookie===
JSESSIONID=7BBDB706EB1006133932EBC11074DB18; Path=/share/; HttpOnly
Cache-Control===
no-cache
Location===
http://localhost:8080/share/page/user/admin/dashboard
Content-Type===
text/html;charset=utf-8
Content-Language===
en-US
Content-Length===
0
Date===
Thu, 18 Apr 2013 07:01:52 GMT
null===
null
302
http://localhost:8080/share/page/user/admin/dashboard
04-19-2013 04:02 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.