File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes getting button name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting button name" Watch "getting button name" New topic

getting button name

sitaram irrinki
Ranch Hand

Joined: Feb 16, 2005
Posts: 158
Is there a way to know which key has been pressed while sending request to a servlet.
Like GO,REFRESH or BACKSPACE (especially the BACKSPACE).
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33107

No. You only know that the request has been submitted.

You can identify a backspace/reload case by putting a value in the session when the page is first loaded and seeing if it is already there. This is the "token" approach.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: getting button name
It's not a secret anymore!