Skip to content

Instantly share code, notes, and snippets.

@lurodrig
Created November 13, 2018 15:26
Show Gist options
  • Save lurodrig/d71a0f0450d01f459632e444d28e0ab4 to your computer and use it in GitHub Desktop.
Save lurodrig/d71a0f0450d01f459632e444d28e0ab4 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Sample "Hello, World" Application</title>
<script type="text/javascript">
function crossContextRequest() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4
if (xmlhttp.status == 200) {
document.getElementById("somediv").innerHTML = xmlhttp.responseText;
} else if (xmlhttp.status == 400) {
alert('There was an error 400');
} else {
alert('something else other than 200 was returned');
}
}
};
xmlhttp.open("GET", "http://localhost:8082/web-module-4/saml-session-info", true);
xmlhttp.send();
}
</script>
</head>
<body bgcolor=white>
<table border="0">
<tr>
<td>
<img src="http://localhost:8082/web-module-4/images/tomcat.gif">
</td>
<td>
<h1>Sample "Hello, World" Application</h1>
<p>This is the home page for a sample application used to illustrate the
source directory organization of a web application utilizing the principles
outlined in the Application Developer's Guide.
</td>
</tr>
</table>
<button id="somebutton" onclick="crossContextRequest();">Request to different context</button>
<div id="somediv">After click logged username will be displayed here</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment