Example usage for org.apache.wicket.util.string StringValue equals

List of usage examples for org.apache.wicket.util.string StringValue equals

Introduction

In this page you can find the example usage for org.apache.wicket.util.string StringValue equals.

Prototype

@Override
public boolean equals(final Object obj) 

Source Link

Usage

From source file:org.artifactory.common.wicket.component.form.SecureForm.java

License:Open Source License

@Override
protected void onValidate() {
    // Check the random id in the hidden field. This guards against CSRF attacks.
    StringValue requestToken = getRequest().getPostParameters().getParameterValue(TOKEN_NAME);
    if (!requestToken.equals(StringValue.valueOf(getToken()))) {
        String message = "Attempted unauthorized form submission";
        log.warn(message);/* w  ww  .  j a v  a  2  s .c om*/
        AccessLogger.unauthorizedFormSubmit(message);
        throw new UnauthorizedActionException(this, new Action("submit without CSRF token"));
    }

    super.onValidate();
}