0

Is there any way to configure my web aaplication in Java EE so that if JavaScript is not enabled, it always opens a error page.

Thank you

1 Answer 1

1

You can use <noscript> tag to show message or link that javascript is not enabled. However its always a best practice to make functionality with graceful degradation.

Try this

<noscript>
<meta http-equiv="refresh" content="0; url=http://www.example.com/error" />
</noscript>
Sign up to request clarification or add additional context in comments.

3 Comments

This one, I will have to apply this tag to every page, Is there any way to do it globally, like defining in web.xml
JavaScript is client side so it cannot be determined by your server before sending the response, so unfortunately not. you can write this code in separate jsp page and include that jsp in all your pages.
Thanxx for your suggestion, I'll apply this.

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.