Reputation: 21
I have very new to the thymeleaf, and I am trying to include:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
but i am getting the error like:
HTTP Status 500 - Request processing failed; nested exception is org.thymeleaf.exceptions. TemplateInputException: Exception parsing document: template="test", line 5 - column 103
and the line number five is the above script So how to resolve this problem?
Upvotes: 1
Views: 1994
Reputation: 21
You need to include &
in place of &
and put ;
at the end as shown below:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
Upvotes: 1
Reputation: 1756
In this example you can see how to add path variables to a src URL and also how to read environment properties.
<script th:src="@{https://maps.googleapis.com/maps/api/js(key=${googleApiKey}, libraries=places, sensor=false)}"
th:with="googleApiKey=${@environment.getProperty('googleapis.api_key')}"
src="https://maps.googleapis.com/maps/api/js"></script>
Upvotes: 1