This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS org.apache.logging.log4j:log4j-core:2.14.0 | |
//DEPS org.apache.logging.log4j:log4j-api:2.14.0 | |
//RUNTIME_OPTIONS -Dlog4j2.enableJndiLookup=true -Dtest.system.property=the-test-value | |
import org.apache.logging.log4j.Level; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import org.apache.logging.log4j.core.config.Configurator; | |
import org.apache.logging.log4j.core.config.builder.api.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<head> | |
<script> | |
function doClick() { | |
// May need cross-browser support | |
//var evt = document.createEvent("HTMLEvents"); | |
var evt = new Event("change"); | |
var element = document.getElementById("id-2"); | |
evt.initEvent("change", false, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Templated | |
@Page(role = LoginPage.class) | |
public class LoginForm extends Composite { | |
@Inject @DataField | |
private TextBox username; | |
@Inject @DataField | |
private TextBox password; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/services") | |
public interface RestService { | |
@GET | |
@Path("/name-lookup") | |
@RestrictedAccess | |
public String getMyName(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@RestrictedAccess | |
public class SecureService implements MessageCallback { | |
public void calback(Message message) { | |
// ... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Remote | |
@RestrictedAccess(roles = "user") | |
public interface RemoteService { | |
public void authenticatedUserService(); | |
/* | |
* Because this method and its enclosing class are both restricted, | |
* a user must have both roles to access this. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Page(role = { LoginPage.class, SecurityError.class }) | |
public class Login extends SimplePanel { | |
// Add widgets for login form here... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Page | |
@RestrictedAccess(roles = "admin") | |
public class AdminPage extends SimplePanel { | |
// Nothing to see here... move it along... | |
} |