List of usage examples for org.apache.wicket.request.resource ResourceReference of
public static final ResourceReference of(Key key, SerializableSupplier<IResource> resourceSupplier)
From source file:org.wicketstuff.rest.lambda.mounter.LambdaRestMounter.java
License:Apache License
/** * Mount rest resource./*from w w w. j a v a2 s .co m*/ * * @param httpMethod the http method * @param path the mounting path * @param resource the resource * @return the resource mapper */ protected ResourceMapper mountRestResource(final HttpMethod httpMethod, final String path, IResource resource) { ResourceReference reference = ResourceReference.of(path + "_" + httpMethod.name(), () -> resource); if (reference.canBeRegistered()) { application.getResourceReferenceRegistry().registerResourceReference(reference); } RestResourceMapper mapper = new RestResourceMapper(path, reference, httpMethod); application.mount(mapper); return mapper; }