The trackpad on my Macbook Pro just started acting oddly. It's randomly clicking (which might cause me to switch programs), right-clicking and even once my screen even showed the swiping animation as if I was trying to switch to a different desktop.    

Part of me fears that this is some sort of joke hacking attempt (I know of a USB device you plug into someones computer and it randomly moves their mouse and types on their keyboard), but there is nothing plugged into my machine and I just turned off the Wi-Fi and watched as this web page tried to close, the mouse right clicked twice, highlighted a word and clicked "Paste and Match Style" in the Chrome right-click menu.
Also as I've been typing (with my Wi-Fi turned off) the mouse has randomly been clicking inside this question and changing where I am typing.  

I just plugged in a USB mouse which seems to work fine but the trackpad is now nearly useless. I can't even move the mouse cursor more than a few centimeters with it.

Is this a common issue?
EDIT
I think it is dying actually. I can now click but not move at all with the trackpad, while a regular mouse works fine.
EDIT 2
And now it seems to be working again. I turned on the option for "Ignore Trackpad when Mouse is plugged in" under Universal Access. I cleaned the trackpad with rubbing alcohol, I whined and complained for a few minutes to my dog, turned off the "Ignore Trackpad" setting, unplugged the USB mouse, and the Trackpad appears to be working mostly normally.
If I run my finger across it at the top or bottom portion of the mouse, it works, but there is a line horizontally across it (almost exactly where a physical trackpad button would end on the old trackpads) that is "dead".  The mouse stops moving, or moves sluggishly when hitting that spot and that "spot" goes across the whole trackpad.


Question: Spring security - Access to a controller method based on an attribute
Answer: One approach is to use a handler interceptor.

Here is general idea:

(1) Configure url patterns which you want to block:

&lt;util:list id="sysEnableCheckUrlPatterns" value-type="java.lang.String"&gt;
    &lt;beans:value&gt;/module1/**&lt;/beans:value&gt;
    &lt;beans:value&gt;/module2/**&lt;/beans:value&gt;
&lt;/util:list&gt;


(2) Write an interceptor:

    public class SysEnableCheckInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {


            /* 
                If system enabled then return true. Otherwise return false (and optionally write something in response)

            */
    }
}


(3) Configure that interceptor. In 3.1 you can do it as follows:

    @Configuration
public class AppConfig extends WebMvcConfigurerAdapter {

    @Resource(name="sysEnableCheckUrlPatterns")
    /* or use @Autowired or @Inject if you like */
    private String[] sysEnableCheckUrlPatterns;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    registry.addInterceptor(new SysEnableCheckInterceptor()).addPathPatterns(sysEnableCheckUrlPatterns);

    }

}