javascript is not the best way to check for conditions and redirect to different page. use MVC
pattern. From a
jsp, redirect to a
servlet and check for conditions there. Do all the business logic in the servlet and then redirect back to a jsp based on the condition.
This way, you never have to modify the jsp again. Just keep changing the business logic in servlet whenever required.