1

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?

2 Answers 2

1

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>
Sign up to request clarification or add additional context in comments.

Comments

1

You need to include &amp in place of & and put ; at the end as shown below:

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false&libraries=places"></script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.