One major concern I have involves sending encrypted data (encrypted before sending the request) to a servlet. I attempted to call a function that encrypts passwords as an example, but I encountered difficulty passing values from JavaScript to Java code in JSP.
<script>
function login() {
var password = document.getElementsByName("newPassword");
console.log(password);
}
</script>
</head>
<body>
<form class="login" action="servlet example" method="Post">
<h1 class="login-title">BSH Login</h1>
<h3><%=request.getAttribute("message") != null ? request.getAttribute("message") : ""%></h3>
<input type="text" class="login-input" name="username"
placeholder="Bsh UserName" autofocus> <input type="password"
name="passowrd" class="login-input" placeholder="Password"> <input
type="submit" value="Login" onclick="login()" class="login-button">
</form>
</body>
I am determined to find a way to securely send encrypted data from JSP to a servlet without using HTTPS.