I'm working on a Spring Boot application. I use main.html
as a frame around all the other .htmls embedded. For this I use layout:fragment
.
I also have a "DATABASE" menu in my navigaton bar, which points to the H2 database console.
Is it possible to embed this console into the main.html
as fragment?
main.html
's body:
<body>
<div class="container">
<nav class="navbar navbar-default">
<ul class="nav navbar-nav">
<li><a href="/">HOME</a></li>
<li><a href="/blogs">BLOGS</a></li>
<li><a href="/bloggers">BLOGGERS</a></li>
<li sec:authorize="hasRole('ROLE_ADMIN')"><a href="/admin">ADMIN</a></li>
<li sec:authorize="hasRole('ROLE_ADMIN')"><a href="/database">DATABASE</a></li>
<li><a href="/signup"><button id="signup-small-button" class="btn btn-success">SIGN UP</button></a></li>
</ul>
<div class="navbar-right">
<form sec:authorize="!isAuthenticated()" th:action="@{/loginfailed}" method="post">
<input th:value="${username}" type="text" name="username" placeholder="username" required class="login-input"/>
<input th:value="${password}" type="password" name="password" placeholder="password" required class="login-input"/>
<button type="submit" id="login-button" class="btn btn-success btn-xs">Log in</button>
</form>
<div sec:authorize="isAuthenticated()">
<span th:text="${#authentication.name + ' | '}" class="black"></span>
<form th:action="@{/logout}" method="post" id="logout-button-form">
<button type="submit" id="logout-button" class="btn btn-primary btn-xs">Log out</button>
</form>
</div>
</div>
</nav>
<div layout:fragment="content"></div>
<footer>
<hr/>
<p id="footer">Made by hazazs (©Copyrighted by hazazs™)</p>
</footer>
</div>
</body>