The Simplest Possible Web Component (CustomElement)

A WebComponent (CustomElement) is an ES 6 class:


class HelloWorld extends HTMLElement { 
    connectedCallback() { 
        const message = "world";
        this.innerText = `
            hello, ${message}
        `;
    }
}
customElements.define('hello-world',HelloWorld);    

which renders itself after including in a "html" page:


<!DOCTYPE html>
<html>
<body>
    <hello-world></hello-world>
    <script src="HelloWorld.js"></script>
</body>
</html>    

WebComponents are supported in all recent browsers.

See you at "Build to last" effectively progressive applications with webstandards only -- the "no frameworks, no migrations" approach, at Munich Airport, Terminal 2 or effectiveweb.training (online).


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Custom Map Updates without Null Checks: Map#merge

The Java 1.8+ Map#merge method is useful for upserts of a Map with custom bevavior. Null checks are not required:


import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;

public class MapMergeTest {

    @Test
    public void mergeInMap() {
        Map<String, Integer> map = new HashMap<>();
        int initial = 1;
	
        int result = map.merge("key", initial, (oldValue, newValue) -> oldValue + newValue);
        assertThat(result, is(1));

        int update = 42;
        int expected = initial + update;
        result = map.merge("key", update, (oldValue, newValue) -> oldValue + newValue);
        assertThat(result, is(expected));
    }
}

The Map#merge is equivalent to:


if (oldValue != null ) {
    if (newValue != null)
        map.put(key, newValue);
    else
        map.remove(key);
    } else {
    if (newValue != null)
        map.put(key, newValue);
    else
        return null;
    }    

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Installing and Deploying Swagger UI

The following dependency:


<dependency>
    <groupId>org.microprofile-ext.openapi-ext</groupId>
    <artifactId>swagger-ui</artifactId>
    <version>1.0.2</version>
</dependency>

installs the Swagger UI "website" and makes it available directly from a configurable URI (in our case: http://localhost:8080/openapiui/resources/openapi-ui/).

The example was deployed with wad.sh to payara.fish. Warning: most application servers / runtimes already ship with Swagger UI.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Threads, Transactions, EntityManager, Fluid Logic,Quarkus, AMQP and Jakarta EE -- the 67th airhacks.tv

The 67th airhacks.tv episode covering:

"Jakarta EE without Docker and FatJARs, Fulltext Search, Connection Pools, Password Management, Fluid Logic, Thread-Safety and EntityManager, Quarkus productivity, AMQP, Jakarta EE"

...is available:

Any questions left? Ask now: https://gist.github.com/AdamBien/2735e9c8845fe1eba40720281d9c2c09 and get the answers at the next airhacks.tv.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Change Data Capture, Debezium, Streaming and Kafka--airhacks.fm Podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #58 airhacks.fm episode with Gunnar Morling (@gunnarmorling) about:

Change Data Capture with Debezium, Streaming, Kafka and Use Cases
is available for download.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Jakarta EE without Docker, Fulltext Search, Connection Pools, Passwords, Fluid Logic, Thread-Safety and EntityManager--or 67th airhacks.tv

Topics for 67th airhacks.tv episode (https://gist.github.com/AdamBien/1a227df3f1701e4a12a751d3f7d1633e):

  1. Quarkus JSF
  2. The best approach to deploy Jakarta EE applications without Docker / containers
  3. Fulltext search with JPA and EclipseLink
  4. Integration testing and databases
  5. Configuring the number of DB connections in a connection pool
  6. Quarkus datasource configuration
  7. Thoughts on "Fluid Logic" pattern implementation
  8. EntityManager: transactions vs. thread-safeness
  9. Integration tests with JPA and auto-registration
  10. Jakarta EE and Java EE specifications
  11. JAX-RS and the added value of @Stateless
  12. The easy setup of Jakarta EE

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Jason's Binding and Fast, Greek Birds--airhacks.fm Podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #56 airhacks.fm episode with Dmitry Kornilov (@m0mus) about:

JPA-RS, EclipseLink, JSON-B and the road to helidon.io
is available for download.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Authentication and Authorization with MicroProfile JWT and Payara Server

Authentication and authorization with MicroProfile JWT and Payara:

Tokens were generated with: jwtenizr.sh, the application was deployed with wad.sh.

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Building and Deploying a Quarkus ThinJAR on OpenShift

How to build and deploy a stock quarkus ThinJAR on OpenShift (OKD):

I used the following CLI commands (name of the openshift project: airhacks, name of the service: qshift)


oc new-build --strategy docker --dockerfile - --code . --name qshift < ./src/main/docker/Dockerfile.jvm
oc start-build --from-dir . qshift --follow
oc new-app --image-stream airhacks/qshift --name qshift
oc expose svc qshift --port=8080

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

SOUJava: Jakarta EE 8 + Microprofile 3.0: Live Coding - With Even Less Ceremony #slideless

In this session I'm creating "from scratch" (with Jakarta EE 8 archetype) communicating microservices, including System Test and continuous deployments with wad.sh (=>full mvn clean install on every edit).

The prometheus metrics were gathered with MicroProfile Metrics, common microservice patterns implemented with MicroProfile Fault Tolerance, "swagger" endpoint was exposed with MicroProfile OpenAPI, and JAX-RS 2.X exception handling was presented. There was enough time left to discuss the internal design and architecture of a pragmatic microservice:

 

Big thanks to SOUJava https://soujava.org.br for the invitation!

See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Web Apps, SPA, PWA with vanilla Java Script (ES 6+), CSS 3 and WebStandards only. As simple as possible, but not simpler. See you at: (Progressive) Web apps, Single Page Apps and WebStandards airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Online Workshops
realworldpatterns.com
...the last 150 posts
...the last 10 comments
License