Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThymeleafViewResolver not used by Spring 4.1 resulting in "circular view path" error [SPR-12013] #16629

Closed
spring-projects-issues opened this issue Jul 21, 2014 · 6 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 21, 2014

Julien Martin opened SPR-12013 and commented

I use the following libraries:

  • Spring Framework 4.1.0.BUILD-SNAPSHOT
  • Spring Security 4.0.0.M1
  • Thymeleaf 2.1.3.RELEASE
  • Thymeleaf thymeleaf-extras-tiles2-spring4 2.1.1.RELEASE
  • Thymeleaf thymeleaf-extras-springsecurity3 2.1.1.RELEASE

And I have configured my view resolver as follows:

@Bean
   public ThymeleafViewResolver viewResolver() {
       ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
       viewResolver.setViewClass(ThymeleafTilesView.class);
       viewResolver.setTemplateEngine(templateEngine());
       viewResolver.setCharacterEncoding("UTF-8");
       return viewResolver;
   }

and it seems the above view resolver is not found by Spring causing it to use the default "internal view resolver" and resulting in a circular view path error.

Please note that I am not sure whether this is a Spring or Thymeleaf issue and I have therefore opened an issue in Thymeleaf too.


Affects: 4.1 RC1

Reference URL: thymeleaf/thymeleaf-spring#64

Issue Links:

Referenced from: commits 9092102

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

This is most certainly related to the newly added support for configuring view resolution in the MVC config. Can you confirm that setting the order property to something like 0 makes it work again?

@spring-projects-issues
Copy link
Collaborator Author

Julien Martin commented

Rossen,
I can confirm that setting the order of the view resolver to 0 sorts the problem:

@Bean
public ThymeleafViewResolver viewResolver() {
     ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
     viewResolver.setViewClass(ThymeleafTilesView.class);
     viewResolver.setTemplateEngine(templateEngine());
     viewResolver.setCharacterEncoding("UTF-8");
     viewResolver.setOrder(0);
     return viewResolver;
}

Julien.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Okay thanks for confirming that. We should have a snapshot with a fix sometime soon.

@spring-projects-issues
Copy link
Collaborator Author

Julien Martin commented

Great!!

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

This should now be resolved. You can confirm with the latest 4.1.0.BUILD-SNAPSHOT.

@spring-projects-issues
Copy link
Collaborator Author

jonas.lima commented

Are spring-boot-starter-parent 1.4.0.RELEASE have the same issue?
'Cose to me show same problem:

javax.servlet.ServletException: Circular view path [index.html]: would dispatch back to the current handler URL [/performance/index.html] again. Check your ViewResolver setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants