JSP/Struts - Detect Caps Lock

I have an application in struts on a tomcat server and i'm looking to add some caps lock functionality to my login form.
I'd like for my page to display a warning - WARNING: You have caps lock on, on the login page every time the user hits it, similar to the caps lock warning in any windows login.
So its something like:
login.jsp
WARNING: CAPS LOCK ON
UserName: _________
Password: __________
Any suggestions on how to go about this?
I found a couple of solutions on google:
1) Use javascript. The problem with this is that all solutions have:
<input type="text" onclick=checkcapslock()>
so the check is only made when the user types something in, and the only way to alert the user is through a javascript popup, which is user unfriendly, as opposed to writing to the document
2) java based solutions. These seem the best way to do it, but i would have to have a constant thread running which will constantly check for the key press. Ideally i dont want an extra thread in addition to the tomcat thats already running. How can i integrate this with the tomcat server?
Thanks y'all

You can't from the server side, you could only do this from the client side. This "checkcapslock()" Javascript thing... that would be one way, you could call it anywhere, presuming you can actually tell that caps-lock is on with Javascript, and I am not sure there is a way.
The only other way might be if you used an applet that maybe could check. Otherwise, I would generally not worry about it.

Similar Messages

  • How to detect Caps Lock without pressing any keys

    I am trying to make the password login and would like add this feature to my website and don't know how to do it.
    I wrote the code below to detect the Caps Lock but it couldn't detect the cap lock at start up.
    if(flash.ui.Keyboard.capsLock){trace("CAP WAS ON")}else{trace("CAP WAS OFF");};
    The result for this code is always return "false" unless I put this code in the eventlistener and have to press the keyboard

    you must wait a moment for your stage to initialize.  use a delay of 1ms or so to check for caplock.

  • Detecting the State of Caps Lock

    I have a rather interesting problem - to which so far there seems to be a surprising lack of information.
    I wish to determine the state of the CAPS LOCK key as well as the INSERT / OVERWRITE - and as I think these are pretty standard, there should be a platform independent way to test the state of these.
    I can find no clues however - any suggestions would be appreciated.

    Try using public boolean getLockingKeyState(int keyCode) which is in java.awt.Toolkit
    http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Toolkit.html#getLockingKeyState(int)

  • How can i bind something to caps lock in AwesomeWM?

    Recently i've aquired new notebook which doesn't have caps_lock, num_lock and scroll_lock LEDs, so i decided to put keyboard layout indicator to system tray.
    Currently i am using Xorg config to set XkbLayout and XkbOptions (like so http://paste.pocoo.org/show/478789/ ).
    I tried first widget from http://awesome.naquadah.org/wiki/Change_keyboard_maps but soon realized that it does not detect layout change in any way, so i would like to bind kbdcfg.switch function to caps_lock, but i can't find any documentation on binding something to caps_lock.
    Also i've noticed a strange thing, when i change my layout with this function i am unable to use shortcuts that use latin letters. They are obviously remapped to by сyrillic, but they do work if i change my layout with caps_toggle. Why do the work with caps_toggle, and how can i make them work with kbdcfg.switch?

    blin wrote:
    filam wrote:Is there a reason you're not using xmodmap? You may also want to read the Extra Keyboard Keys in Xorg article.
    The only reason i have for not using xmodmap is, i don't understand how it can help me, with the task i have. The other article didn't help me either.
    Did you read the "How to find capslock status?" thread?
    blin wrote:Is suspect the answer is not what you want because your question is not very clear. I understand that you have a keyboard that is lacking certain keys. What is it that you want to achieve? Let some key act as capslock?
    I had to read the OP twice to understand it. I didn't notice that he wrote "LED" in the first sentence. What he wants is for his Awesome status bar to display the current activity (i.e. on/off) of the Caps Lock, Num Lock and Scroll Lock keys. He does not need to remap any keys.
    Edit: Check Retrieving CAPS LOCK info using Xlib or just do a Google search for "linux caps lock status -map -disable".
    Last edited by filam (2011-09-20 19:43:45)

  • No display while caps lock LED blinks

    Hi
    Please could someone help me.
    For about 2 weeks now my laptop has refused to display anything. When I turn it on, nothing displays on the screen but the caps lock LED blinks once every 2 seconds. Also the wireless button displays orange light but nothing on the screen.
    It managed to display once in this 2 weeks and the error message I was able to see before it came on read something like:
    HP Battery Alert
    The system has detected the storage capacity of .....(did not see all the message on this line)
    very low. For optimal performance, this battery .... (did not see all the message on this line also)
    Primary(internal) Battery (601)
    ENTER - Continue Startup
    For more Information, please visit:

    Hi IIHenriquell,
    Take a look at this document.  Follow the 'Update BIOS and Software' section and let me know if it helps resolve your issue.
    Good luck!
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Regading Caps Lock Button

    Hi,
    My application allows Caps letters only for every input field.
    So I wouldn’t like to write java script function.
    Do we have any application level settings or caps lock button disable settings while page loading.
    This assistance has more helpful for me.
    Thanks
    Rama Krishna Alla.

    No, you (fortunately) cannot control the client side environment from the server side on, so you can't do anything with Java/JSP/JSF which just runs at the server machine and just produces some HTML/CSS/JS which is to be sent over network to the client machine. Use a client side language like JavaScript. No, there are no other ways. Maybe ActionScript (aka Flash) but this might not be what you're looking for.
    For the case you stucks with JavaScript, there are JS forums at webdeveloper.com and dynamicdrive.com. Good luck.

  • Sense The Cap Lock

    Is there anyway in TestStand 3.0 to detect the position of the Cap-Lock key?  Depending upon its state, it will either be OK or cause my barcode reader to give me fits.  Your thoughts?
    Tony

    Hello Tony,
    You can use the Win32 function GetKeyState to figure out if the caps-lock is toggled or not. 
    You can find more information on this function on MSDN:
    http://msdn.microsoft.com/en-us/library/ms646301(VS.85).aspx
    You can pass 20 into this function to get the status of the caps-lock key.
    I made an example in TestStand to show you how to call this function and then displays the result. 
    Please let me know if you have any questions.
    Kristen
    National Instruments
    Attachments:
    capsLock30.seq ‏26 KB

  • Compaq Presario CQ56, Caps Lock Blinks

    I have a Compaq Presairo CQ56-115DX.
    I turned it on one day and the caps lock key's led blinks, at 3 second intervals. (Never stops, waited 4 or 5 hours)
    I have looked at the page on HP support, I have tried hard reset, reseatingk, and replacing the CPU.
    Still an issue.
    When I hard reset, I've tried with and without wifi, hdd and ram installed.

    Here is a document on the Blinking lights -
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01443366&cc=us&dlc=en&lc=en
    they contain a code:
    The LED lights near the Caps Lock and Num Lock keys will blink if an error is detected during the start up process. The LEDs will blink a number of times in a sequence and then stop. The number of blinks in the sequence indicates what component caused an error when it was being tested during start up.
    If the LEDs stop blinking and the computer does not start, you can press the power button again to repeat the tests. Count the number of blinks, and use the chart to identify the error condition.
    Knowing the number of blinks is helpful when you contact an HP support agent for technical help.
    Caps Lock/Num Lock LED Component Tested Error Condition
    LEDs blink 1 time
    CPU
    CPU not functional
    LEDs blink 2 times
    BIOS
    BIOS corruption failure
    LEDs blink 3 times
    Memory
    Module error not functional
    LEDs blink 4 times
    Graphics
    Graphics controller not functional
    LEDs blink 5 times
    System board
    General system board failure
    LEDs blink 6 times
    BIOS
    BIOS authentication failure
    I am an HP employee.
    "Did my response help with your issue? If so, please give me Kudos by clicking the "Kudos" button or mark the post that solved your problem as the Accepted Solution. Thanks!"

  • DV6-7010US Caps lock flash, no POST

    System was not used for several months. When we tried to use it, the system was extremely unstable and crashed several times with Windows blue screen errors, randomly didn't detect the hard drive, etc. Then it just stopped booting at all, and instead has the orange WiFi light with the caps lock LED flashing once every second (or so) indefinitely. LED error codes list says this is "CPU not functional." Since then, both the motherboard and CPU have been replaced, but the system still gives the same LED error code.
    Motherboard was ordered straight from HP Parts surfer, CPU from a 3rd party company with guarantee that item is tested as fully functional. Reports from this forum and others on this system and motherboard replacements are not overly positive. I'm tired of dumping money into this laptop and it not working. Any suggestions would be greatly appreciated.

    docminor wrote:
    System was not used for several months. When we tried to use it, the system was extremely unstable and crashed several times with Windows blue screen errors, randomly didn't detect the hard drive, etc. Then it just stopped booting at all, and instead has the orange WiFi light with the caps lock LED flashing once every second (or so) indefinitely. LED error codes list says this is "CPU not functional." Since then, both the motherboard and CPU have been replaced, but the system still gives the same LED error code.
    Motherboard was ordered straight from HP Parts surfer, CPU from a 3rd party company with guarantee that item is tested as fully functional. Reports from this forum and others on this system and motherboard replacements are not overly positive. I'm tired of dumping money into this laptop and it not working. Any suggestions would be greatly appreciated.
    Hi,
    Remove the hard drive and boot up. If you can get to the BIOS, the hard drive is faulty. It's highly unlikely that the new board and the cpu will cause exactly the same error. It means that some other component from the system must be faulty. 
    Dv6-7000 /Full HD/Core i5-3360M/GF 650M/Corsair 8GB/Intel 7260AC/Samsung Pro 256GB
    Testing - HP 15-p000
    HP Touchpad provided by HP
    Currently on Debian Wheeze
    *Please, help other users with the same issue by marking your solved topics as "Accept as Solution"*

  • Caps lock button not sensitive enough

    I just bought a new macbook air , and I found that the caps lock button not as sensitive as other buttons, what should I do now ?
    I have to press a bit longer and harder to make it detected.
    thanks!

    I'm not sure if you've resolved this issue but I solved the problem by removing the charger plug, then the battery.  While the battery is out, push the power button.  Reinstall the battery and reconnect power.  When the notebook rebooted, the caps lock light and num lock lights were once again working.

  • Num + caps lock on MBP 17"

    I reinitialized a MBP from the recovery DVD.
    At the very beginning of the process num + caps lock lighted up and remained so through the complete installation. I did not touch them before and during the installation
    After the installation war finishet, I found out the both functions would work in reverse mode, meaning:
    num is on = the keyboard works normally
    num is off = I can enter the numbers only
    caps lock is on = keyboard works the normal way
    caps loc is of = only uppercase characters show when typing
    Maybe this is an old question.
    The mbp had been initialized after purchase by its first owner (from which I purchased it) and it worked normally when I checked it before purchasing it.
    Any idea?

    Have you tried resetting your PRAM (KB) or the PMU (KB)?
    Yang

  • I suddenly have two flashing lights on my keyboard by the caps lock key and over the end/pg up key.

    I encountered a problem waking my laptop (Pavilion dv7-1270us) this morning.  At first it would not wake up and had to do a hard reboot.  Now I have two flashing lights on the keyboard -the caps lock light and the one over the end/pg up keys over the number pad.  I have run several diagnostics and cannot find an answer as to what this is.
    This question was solved.
    View Solution.

    Hi,
    You're welcome and it's good to hear you've got it working
    All the best,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Caps lock/scrol​l lock/num lock/ LEDs not working - instead pop-ups in bottom RH corner of screen

    Specific details; p/n: GS066PA#ABG,  4 GBytes DDR2 RAM, OS Windows 7 (6.1) Ultimate Edition 64-bit Service Pack 1 (Build 7601) DirectX 11.0.  LED's were working but during one of the windows automatic updates they stopped working.  I don't know which update.  Now I get little pop-ups "CAPS LOCK: ON" etc (black text on white background).  If I rename bttray.exe to bttray1.exe and restart the laptop, that kills the pop-ups in the bottom RH corner of the screen but it does not restore the operation of my blue indicator LED's.  Can anyone help please?

    Hi @haggis1 ,
    I saw your post regarding the problems with the pop-ups and LED lights not working after a Windows Update. Most likely there was a problem with the update when it was installed. This Microsoft Support link will show you how to uninstall an update. Try uninstalling the most recent updates and the restart the notebook and see if the LEDs start working again.
    If that fixes the issue then there is another section in that link entitled: I remove an update but it gets automatically installed. That will show you how to hide an update.
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

  • Problem that starts with *apparent* sticking caps lock key

    I have a mid-2009 MacBook Pro (two weeks outside of AppleCare, of course!).  Last night, it appeared the caps lock key was sticking. It would type in all caps even when I hit the button and the green indicator light went off. Moments later, I noticed that the option that shows you all the windows on the same screen was suddenly going very, very slow. I tried to restart but it started in safe mode - twice. It finally started correctly on the third or fourth reboot. I hoped it was a fluke.
    Unfortunately it's happening again and rebooting doesn't seem to fix it - I can't put in my password to login because it thinks I'm typing in all caps.
    Any ideas, please?  Thanks.

    This may enter the Apple Hall of Fame for stupid posts.  I spent a couple hours last night restarting the computer, trying restore etc....and really doing anything I could from clinton's link in order to identify the problem.  I'd even called our local store to let them know I would be there first thing in the morning (I'm boarding a plane in a few minutes and really needed my laptop for this trip).
    So after doing all of those things + removing the caps lock key to see if it was somehow manually stuck, I go the store this morning.  Virtual panic.  I needed a presentation off the laptop for a workshop tomorrow and I hadn't backed up since I created it...
    I enter the store, I begin to explain the situation in detail, I open up the laptop....
    And the guy at the store says "Did you notice your shift key is stuck down?".  Why No, I hadn't noticed that!  With a tiny wiggle and a tap, that key popped back into place and the computer worked fine.  The Safe Mode was happening because the shift key was down.

  • HT1192 caps lock function does not work after latest update

    Hi there,
    I have a Macbook 13" Early 2011 and recently after updating my operating system to Mac OS X 10.7.4, i have found that the caps lock button isn't functioning.
    At present if i hold or press the button, it is failing to light up or function at all.
    Is there a fix for this issue, as i have read that there was an update by Apple to stop accidental pressing of this key, however not being able to access its function at all seems to be unusual.
    Your thoughts and opinions would be much appreciated,
    Thanks,
    Robsterhill101

    My Macbook Pro Early 2011 15"  (base model) did this to me last night.
    I did a PRAM Reset, the generic "Cure All Procedure" for Macs. It worked after, but I noticed that the button had to be pressed at just the right angle and with enough pressure. The light would come on and off and Caps Lock functions properly. Continued as normal.
    I put the computer to sleep by simply closing the lid, and then put myself to sleep as well.
    This morning, just before I came on here, my computer would NOT wake from sleep (a whole other issue). Would not wake up by pressing the power button. So I had to do a hard reset, hold the power button down, and press it again after...grrr I never feel good being forced to do this.
    Anyways long story a little bit shorter, I restarted my computer and low-and-behold the Cap Lock is not working again. No Bueno, Cupertino.
    No, sorry, no liquid damage on the keys, and I don't have kids, nor share my computer with anyone but myself.
    Its one of the few things that bug me about this computer. The other is the issue of the computer not being able to wake from sleep. Too often.
    SHOULDA BOUGHT THE APPLE CARE
    Simply Because, perfect timing after the years original warranty, you will experience problems. After all, they do want you to be a repeat customer. IYKWIM

Maybe you are looking for

  • Open report in pdf format without opening in browser.

    Hi, Any body know show can save my report in pdf formate in a specific folder without opening in browser. I am using 9.0.4 developer suit. Regards

  • Scheduled job does not stop even after the scheduling window closes

    We have written custom stats gathering job whose duration has been set as 14 hours in the schedule. This job starts daily at 6:00 PM and expected to complete upto 8:00 AM next day. But the problem is that this job continues to execute even after 14 h

  • Iwant to create Report using master data

    i have created master data characteristic with attributes,is there is possible to create the info provider with the characteristic and attributes with transaction data and i want to create report in that cube.

  • Hidden Command prompt

    Hi, I want to run a batch file in java program,and i want to hide the command prompt javaw @echo off is not working Please Help Me

  • Formula to convert Hex to Decimal

    Hello All, I have "upgraded" from AppleWorks to iWork Numbers. Yes I've read all about how somethings didn't get ported over, etc. What I need is a formula to convert base 16 to base 10. Any ideas how to do this? I see that numbers has a formula edit