Replace VisionUnsHSBC.jsp

parent 630cca2e
...@@ -10,7 +10,7 @@ UserInfoBean userInfo = null; ...@@ -10,7 +10,7 @@ UserInfoBean userInfo = null;
String message = ""; String message = "";
try try
{ {
String url = "/ibase/jsp/VisionUnsHSBC.jsp"; String url = "/ibase/webitm/jsp/VisionUnsHSBC.jsp";
userInfo = (UserInfoBean)session.getAttribute("USER_INFO"); userInfo = (UserInfoBean)session.getAttribute("USER_INFO");
BaseLogger.log("3",null,null,"In VisionUnsHSBC.jsp userInfo:["+userInfo+"]"); BaseLogger.log("3",null,null,"In VisionUnsHSBC.jsp userInfo:["+userInfo+"]");
if( userInfo == null ) if( userInfo == null )
...@@ -27,6 +27,16 @@ try ...@@ -27,6 +27,16 @@ try
%> %>
<%
String baseUrl = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort();
String processPaymentServletURL = baseUrl + "/ibase/ScheduledSftpUploaderServlet";
BaseLogger.log("3", userInfo, null, "processPaymentServletURL [" + processPaymentServletURL + "]");
%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -51,7 +61,7 @@ div { ...@@ -51,7 +61,7 @@ div {
.container { .container {
max-width: 800px; max-width: 800px;
margin: 0 auto; margin: 0 auto;
padding: 20px; padding: 20px;
display: flex; display: flex;
...@@ -60,6 +70,7 @@ div { ...@@ -60,6 +70,7 @@ div {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
}
h1 { h1 {
...@@ -96,30 +107,37 @@ button:hover { ...@@ -96,30 +107,37 @@ button:hover {
<!-- Add any necessary styles or scripts here --> <!-- Add any necessary styles or scripts here -->
<script>
<script> function scheduleSFTP() {
function scheduleSFTP() // Display "Generating..." message
{ document.getElementById("result").innerHTML = "Processing....";
// Create an XMLHttpRequest object
var xhttp = new XMLHttpRequest(); // Create an XMLHttpRequest object
// Define the function to handle the response var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() // Define the function to handle the response
{ xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) { if (this.readyState == 4) {
if (this.status == 200) {
// Update the HTML content with the response // Update the HTML content with the response
document.getElementById("result").innerHTML = this.responseText; document.getElementById("result").innerHTML = "Processing complete: " + this.responseText;
} else {
// Handle errors or show an appropriate message
document.getElementById("result").innerHTML = "Error occurred during processing.";
} }
}; }
// Open a POST request to the server-side servlet };
xhttp.open("POST", "ScheduledSftpUploaderServlet", true); // Open a POST request to the server-side servlet
// Set the Content-Type header for a POST request xhttp.open("POST", "<%= processPaymentServletURL %>", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Set the Content-Type header for a POST request
// You can add data to be sent with the request if needed xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// For example, xhttp.send("param1=value1&param2=value2"); // You can add data to be sent with the request if needed
// Send the request // For example, xhttp.send("param1=value1&param2=value2");
xhttp.send(); // Send the request
} xhttp.send();
</script> }
</script>
...@@ -127,7 +145,7 @@ button:hover { ...@@ -127,7 +145,7 @@ button:hover {
<body> <body>
<div class="container"> <div class="container">
<h1>UNS-HSBC Integration</h1> <h2>Schedule SFTP</h2>
<!-- Add a button that triggers the scheduleSFTP function on click --> <!-- Add a button that triggers the scheduleSFTP function on click -->
<button onclick="scheduleSFTP()">Process Payment</button> <button onclick="scheduleSFTP()">Process Payment</button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment