You can't detect this using any Servlet or JSP API. All you can do is to cause something to happen on the client if JavaScript is enabled, and to detect its effect on the next submission. For example, you could change the value of a hidden input using JavaScript.