You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to find a proper example of a PostProcessor to achieve html minification or any other update on the html output using https://code.google.com/p/htmlcompressor/
There is a simpler Filter solution to achieve this but from this blog Filter as some performance downsides.
I believe this should be a built in feature but as rejected in previous issue.
Getting error with the following implementation, any help is welcome:
threw exception [Request processing failed: org.thymeleaf.exceptions.ConfigurationException: Post-Processor class org.thymeleaf.engine.ITemplateHandler specified for post-processor io.bootify.my_app.minify.StripElementWhiteSpaceDialect$StripElementWhiteSpace in dialect io.bootify.my_app.minify.StripElementWhiteSpaceDialect does not implement required zero-argument constructor.] with root cause
java.lang.NoSuchMethodException: org.thymeleaf.engine.ITemplateHandler.<init>()
at java.base/java.lang.Class.getConstructor0(Class.java:3585) ~[na:na]
at java.base/java.lang.Class.getConstructor(Class.java:2271) ~[na:na]
at org.thymeleaf.DialectSetConfiguration.build(DialectSetConfiguration.java:397) ~[thymeleaf-3.1.2.RELEASE.jar:3.1.2.RELEASE]
The text was updated successfully, but these errors were encountered:
Pre-processors and post-processors are different to processors in that instead of executing on a single event or on an event model (a fragment of a template), they apply to the entire template execution process as an additional step in the engine’s processing chain. Therefore they follow an API completely different to that of processors, much more event-oriented, defined by the lower-level ITemplateHandler interface.
a) ITextProcessor cannot be used in conjunction with IPostProcessorDialect.
b) The method getHandlerClass() defines the implementation of your PostProcessor, so it fails in your case because of
return ITemplateHandler.class;
ITemplateHandler is an interface and does not have a constructor, thus the exception java.lang.NoSuchMethodException: org.thymeleaf.engine.ITemplateHandler.<init>()
@duoduobingbing thanks for the demo. But actually textNode.getText() is not the final complete processed output but rather chuncks. So doesnt fit what i was looking for. Thanks very much anyway.
Following the discussion in #108
I am unable to find a proper example of a PostProcessor to achieve html minification or any other update on the html output using https://code.google.com/p/htmlcompressor/
There is a simpler Filter solution to achieve this but from this blog Filter as some performance downsides.
I believe this should be a built in feature but as rejected in previous issue.
Getting error with the following implementation, any help is welcome:
Getting error:
The text was updated successfully, but these errors were encountered: