O'Reilly logo

Developing Middleware in Java EE 8 by Abdalla Mahmoud

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Designing and implementing the frontend

Let's go further by implementing the frontend of our application. Create an index.html file with the following content:

<!DOCTYPE html> 
<html> 
    <head> 
        <style> 
            button:disabled { color: red; } 
            .my-booking:disabled { font-weight: bold; color: green; } 
        </style> 
    </head> 
    <body> 
       <h1>Book a Seat</h1> 
       <h2 id="movie-label">Seats</h2> <!-- wraps movie id --> 
       <div id="seats_container"/>  <!-- wraps seats buttons matrix --> 
 
        <script> 
             // script goes here 
        </script> 
    </body> 
</html> 

In our HTML, we have included two key UI elements:

  • movie-label: A label that displays the current movie ID
  • seats_container: A div that will contain the buttons matrix for the current movie seats

Now, let's write the required script. We request ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required