Here is my Code:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Example of Java Server Page with JDBC</title>
</head>
<script>
function myFunction() {
var x='<% request.getParameter("ServerName"); %>';
alert(x);
</script>
<body>
<form>
ServerName: <input type="text" name="ServerName" required> <br><br>
<input type="submit" id="btnSubmit" name="btnSubmit" />
</div>
</form>
</body>
</html>
Here in the above function onclick of a button i want to execute the scriptlets which is inside javascript?