Question: I have a single business interface that is implemented by multiple stateless beans.
Each implementation has a annotation at Class level with a unique value.
I use CDI injection as 

```
@Any Instance<MyInterface> implementations;

```

I want to look up a specific implemenattion based a value (which matches the annotation value).
Now since all implementations are EJBs I get an EJB proxy and unable to parse annotation. Please suggest a way to parse the annotation meta data from the proxy.

Also what are the other ways to get the EJB other than JNDI look up in above scenario?

Answer: 
Use the `flex-grow` property to the main content div and give the `display: flex;` to its parent;

```css
body {
    height: 100%;
    position: absolute;
    margin: 0;
}
section {
  height: 100%;
  display: flex;
  flex-direction : column;
}
header {
  background: tomato;
}
div {
  flex: 1; /* or flex-grow: 1  */;
  overflow-x: auto;
  background: gold;
}
footer {
  background: lightgreen;
  min-height: 60px;
}
```

```html
<section>
  <header>
    header: sized to content
    <br>(but is it really?)
  </header>
  <div>
    main content: fills remaining space<br>
    x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>
    x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>
    x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>
    x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>
    x<br>x<br>x<br>x<br>x<br>x<br>x<br>x<br>
  </div>
  <footer>
    footer: fixed height in px
  </footer>
</section>
```
Here is the **codepen demo** showing the solution:

* [Demo - Fill remaining vertical space with CSS using display:flex](https://codepen.io/mprinc/pen/JjGQvae)

Important highlights:

* all containers from `html`, `body`, ... `.container`, should have the **height set** to 100%
* **introducing `flex`** to ANY of the flex items will trigger calculation of the items sizes based on flex distribution:
	+ if only one cell is set to `flex`, for example: `flex: 1` then this flex item will **occupy the remaining of the space**
	+ if there are **more than one** with the `flex` property, the calculation will be more complicated. For example, if the item 1 is set to `flex: 1` and the item 2 is se to `flex: 2` then the item 2 will take twice more of the **remaining space**
		- **NOT TRUE**: the item 2 will be **twice larger** than the item 1
		- check more about the concept of the **remaining space**: <https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow>
* [Main Size Property](https://www.w3.org/TR/css-flexbox-1/#main-size-property)
	+ depends on the value of the `flex-direction` property
	+ in our case height is just a [**preferred** size](https://www.w3.org/TR/css-sizing-3/#preferred-size-properties)
	+ it will be overwritten in the presence of `flex` property: <https://www.w3.org/TR/css-flexbox-1/#propdef-flex>
		- When a box is a flex item, flex is consulted **instead of the [main size property](https://www.w3.org/TR/css-flexbox-1/#main-size-property)** to determine the main size of the box
	+ `min-*` and `max-*` will be respected