I have a security concern about sending secure data (encrypted before sending request) to servlet. I tried to call the function that make encryption for password as example but I can't pass value from Java script 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 seriously need to send encrypted data from JSP to servlet without HTTPS.