0

I have a basic SpringBoot 2.0.4.RELEASE app. using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.

I have this href in a button that is working fine

<input type="button" value="CANCEL" th:onclick="'window.location.href = \'' + @{/user/list/} + '\''" /> 

nevertheless I have a href, where I have to put also the server.servlet.context-path defined the the application.properties file, otherwise the link goes to http://127.0.0.1/user/list

 <a href="/myapp/user/list" class="pure-menu-link"> <i class="fa fa-id-card-o fa-lg fa-fw"></i>&nbsp; USERS </a> 

1 Answer 1

1

You can use th:href just like you're doing for your JavaScript:

<a th:href="@{/user/list/}" class="pure-menu-link"> <i class="fa fa-id-card-o fa-lg fa-fw"></i>&nbsp; USERS </a> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.