0

I'm using the latest version of Thymeleaf with Spring Boot project. I run into a very strange issue where I'm given a stackoverflow error when I use autofocus or required attributes in an element tag. I'm using the latest version of Twitter Bootstrap project. In my project I'm using: Spring Security, ThymeLeaf, and Twitter Bootstrap. The configuration is done using Java Configuration. Below is the code that produces stackoverflow. If I remove autofocus and required attributes the application runs fine.

<form class="form-signin" role="form">
    <h2 class="form-signin-heading">Please sign in</h2>
    <input type="email" class="form-control" placeholder="Email address" required autofocus>
    <input type="password" class="form-control" placeholder="Password" required>
    <label class="checkbox">
        <input type="checkbox" value="remember-me"> Remember me
    </label>
    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
5
  • Please add the stack trace to your question. Your HTML snippet doesn't give any clue to what went wrong. Commented Jun 28, 2014 at 23:47
  • Since it's a stackoverflow the trace message is long. I have created a GIST which is available at the below address: gist.github.com/5db/47a5b163fd8054d39a81 Commented Jun 29, 2014 at 4:16
  • Have you tried using XML compliant tags like required="required" and autofocus="autofocus"? Commented Jun 29, 2014 at 6:43
  • Yes, that works. It looks like a bug in ThymeLeaf library. Commented Jun 29, 2014 at 16:08
  • It's not a bug. If you read the manual, Thymeleaf requires XML compliance. Commented Jan 26, 2015 at 3:08

1 Answer 1

1

Thymleaf requires XML compliance. This means closing tags, and attributes with values. You can use:

required="required" autofocus="autofocus"

Adding the answer as Bart's response helped me.

Sign up to request clarification or add additional context in comments.

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.