Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Too lazy to fill in a turnip here is the link https://dl.dropboxusercontent.com/u/53222029/sprin...
I worked with spring, but I am not a pro in it (as I already said). The thymeleaf docs have an example www.thymeleaf.org/doc/html/Thymeleaf-Spring3.html#... . As I understand it, setting only one order is not enough, although in my mind for some reason it was also that the logic would be the following: resolvers are sorted by order, then we take the first result without exception.
In the same case, all the magic came down to filtering viewNames, all that is required of
you is to add permissions to implement, and write with permission in controllers, I think that this is more than enough.
And yes, this viewNames parameter can be used as you like, you can filter by folder, by permission, write an array etc.
To begin with, present your own version, Google gives out quite a few articles and solutions on SO
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
<property name="order" value="1">
</bean>
<bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
<property name="prefix" value="/WEB-INF/templates/" />
<property name="templateMode" value="HTML5" />
<property name="characterEncoding" value="UTF-8" />
</bean>
<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver" />
<property name="additionalDialects">
<set>
<bean class="org.thymeleaf.extras.springsecurity3.dialect.SpringSecurityDialect" />
</set>
</property>
</bean>
<bean id="ThymeleafResolver" class="org.thymeleaf.spring3.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine" />
<property name="characterEncoding" value="UTF-8" />
<property name="order" value="2">
</bean>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question