This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 1 - Specified Keystroke to Trigger an Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1 - Specified Keystroke to Trigger an Action" Watch "Struts 1 - Specified Keystroke to Trigger an Action" New topic
Author

Struts 1 - Specified Keystroke to Trigger an Action

Jim Borland
Greenhorn

Joined: Oct 26, 2009
Posts: 16
I have an older application that uses Struts 1. Is it possible to designate a particular keystroke (say Alt-A) that will trigger an <action path="triggeredByKeystroke"....> in the struts-config.xml file? Normally these actions are initiated by a menu or using a "form action" in an HTML form. I would like my user to be able to utilize this keystroke at any time during their session and have it jump to this action. Any ideas for how I could do that? Thank you very much!

Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

I don't think there is any way you can specify it in struts, but you can do it with Javascript.'
I use http://www.openjs.com/scripts/events/keyboard_shortcuts/
Jim Borland
Greenhorn

Joined: Oct 26, 2009
Posts: 16
Richard,

Thank you for pointing me to that Javascript website. I think creating a keyboard shortcut using Javascript will allow me to accomplish the goal I have established. Thanks again!
 
 
subject: Struts 1 - Specified Keystroke to Trigger an Action
 
Similar Threads
3 Problems about using Struts
prevent double submission
How to add a Shortcut to menu or menuItem
About Keybinding
customized button for html:file