Validation Page Return Not Generated with Bundles

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Validation Page Return Not Generated with Bundles

arnaldop
My application uses the following:

* Spring Boot (MVC, Security, Tomcat 8)
* Hibernate Validator
* Thymeleaf
* Dandelion Core and Datatables

When I submit a page with invalid data, the Hibernate Validator kicks in, and my Controller returns me to the page.

However, when the page reloads with the validation messages, it seems that Dandelion is not being triggered because none of the bundles are loaded into the page.

I am relying on the dandelion.properties file property bundle.includes to load jquery, jqueryui and bootstrap3.

Nothing shows in the logs that would indicate why the page would load differently the second time than the first.

The application can be found at https://github.com/arnaldop/enhanced-pet-clinic.

Please advise.
Reply | Threaded
Open this post in threaded view
|

Re: Validation Page Return Not Generated with Bundles

Thibault Duchateau
Administrator
This post was updated on .
Hi,

First of all, please update Dandelion to the v0.10.1, which has just been released. This is mainly a bugfixing version that, amongst others, brings a fix for the HTTP POST/PUT/DELETE.

If you still encounter the issue after the upgrade, maybe the DandelionFilter needs a bit more configuration.
I recently had to do the following in a Tomcat 7 instance. I don't know if it's required with Tomcat 8:

<filter>
   <filter-name>dandelion</filter-name>
   <filter-class>com.github.dandelion.core.web.DandelionFilter</filter-class>
</filter>
<filter-mapping>
   <filter-name>dandelion</filter-name>
   <url-pattern>/*</url-pattern>
   <dispatcher>FORWARD</dispatcher> <== ADD THIS
   <dispatcher>REQUEST</dispatcher>  <== ADD THIS
   <dispatcher>INCLUDE</dispatcher>  <== ADD THIS
   <dispatcher>ERROR</dispatcher>  <== ADD THIS
</filter-mapping>

Regards,
Thibault.
Reply | Threaded
Open this post in threaded view
|

Re: Validation Page Return Not Generated with Bundles

arnaldop
Thibault,

Thanks for the quick response.
I wasn't aware of the new version, but that fixed it.

I did not need the web.xml fragment with Tomcat 8.

I switched my configuration to use Tomcat 7 and I still didn't need the changes you mentioned.
Perhaps in my case, since I'm using Spring Boot, the DandelionFilter was "automagically" configured within Tomcat.

Thanks for your help!
Reply | Threaded
Open this post in threaded view
|

Re: Validation Page Return Not Generated with Bundles

Thibault Duchateau
Administrator
Great. Thanks for the test!

Reply | Threaded
Open this post in threaded view
|

Re: Validation Page Return Not Generated with Bundles

SamQiu
This post was updated on .
I have this problem too,but when i update to 0.10.1 it work fine. However There's a problem with 0.10.1 version, we can't render the Unicode correctly event though i set the filter with the dandelion filter

FilterRegistration.Dynamic encodingFilter = servletContext.addFilter("encodingFilter", new CharacterEncodingFilter());
                encodingFilter.setInitParameter("encoding", "UTF-8");
                encodingFilter.setInitParameter("forceEncoding","true");
                encodingFilter.addMappingForUrlPatterns(null, false, "/*");