I want to redirect client from 1.jsp
to 2.jsp
using server-side redirect to avoid the redirect URL being modified and visible in client-side browser dev mode. Currently this line: window.location = "http://localhost:XXXX/XXX/2.jsp";
will expose the url in client-side browser dev mode, I want it to be hidden away from users and redirect still works.
Any possible solution to this?
1.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>This is 1.jsp</title>
</head>
<body>
<script type="text/javascript">
var width = 100;
move();
function move() {
if (width >= 100) {
window.location = "http://localhost:XXXX/XXX/2.jsp";
} else {
// rest of the code
}
}
</script>
</body>
</html>
2.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>This is 2.jsp</title>
</head>
</html>