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>
...@@ -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,22 +107,27 @@ button:hover { ...@@ -96,22 +107,27 @@ button:hover {
<!-- Add any necessary styles or scripts here --> <!-- Add any necessary styles or scripts here -->
<script>
function scheduleSFTP() {
// Display "Generating..." message
document.getElementById("result").innerHTML = "Processing....";
<script>
function scheduleSFTP()
{
// Create an XMLHttpRequest object // Create an XMLHttpRequest object
var xhttp = new XMLHttpRequest(); var xhttp = new XMLHttpRequest();
// Define the function to handle the response // Define the function to handle the response
xhttp.onreadystatechange = function() xhttp.onreadystatechange = function() {
{ if (this.readyState == 4) {
if (this.readyState == 4 && this.status == 200) { 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 // Open a POST request to the server-side servlet
xhttp.open("POST", "ScheduledSftpUploaderServlet", true); xhttp.open("POST", "<%= processPaymentServletURL %>", true);
// Set the Content-Type header for a POST request // Set the Content-Type header for a POST request
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// You can add data to be sent with the request if needed // You can add data to be sent with the request if needed
...@@ -119,7 +135,9 @@ button:hover { ...@@ -119,7 +135,9 @@ button:hover {
// Send the request // Send the request
xhttp.send(); 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