1

I am calling a Servlet from index.jsp using Ajax. If the result is false, I have to display an error message on index.jsp itself. But, if the result is true, how do I call another JSP page?

1 Answer 1

1

In JavaScript, you can use window.location to change the current location.

E.g.

if (result.error) {
    document.getElementById('message').innerHTML = result.error;
} else {
    window.location = 'another.jsp';
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.