-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Roberto Velasco opened SPR-7943 and commented
Nowadays there is an intregration between Spring MVC and HDIV that can be used by adding the HDIV filter and by using Spring MVC's custom tag extension. This means that it is possible to apply HDIV to a web
application developed in Spring MVC in a declarative way, without making any change to the source code.
But this approach has a maintenability disadvantage that forces to release a new set of HDIV custom tags for every new version of Spring MVC. This does not happen to the HDIV core and web filter, as they are
no intrusive extensions.
This problem arises because there isn't a clear extension point of the Spring MVC´s custom tags that will make possible a clear extension of the component's behaviour without having to create a new version of it.
Consecuently, it is necessary to create a new version of HDIV's custom tags for Spring MVC each time a new version of the framework is released.
Also there is the risk that the behaviour of the Spring MVC's custom tags may change in the future and become not compatible with HDIV.
The objective of this new feature is to have an official integration between HDIV and Spring MVC that eliminates the maintenance cost that exists today for new versions of Spring MVC. This integration will provide an integrated and compatible solution even for future versions of both frameworks.
In order to get this purpose, we propose the creation of a Java interface or contract that will be used by Spring MVC's custom tags. With this extension point it will no longer be necessary to create specific Spring MVC custom tags for HDIV, reducing the integration task to only implementing the interface.
I have attached an interface proposal (ParameterProcessing).
Spring MVC tags should use this new interface in order to avoid tags extension. I have attached two examples of Spring MVC tags (FormTag, HiddenTag) using this new interface.
HDIV needs to process al urls sent to the client and needs to intercept redirects. Currently we extend Spring MVC default viewResolver. Spring MVC ViewResolver should use the new interface in order to avoid the extension.
This Java interface for Spring MVC tags could be used for other objectives besides integrating with HDIV. For example it could be used for integrating Webflow with Spring MVC.
Webflow needs to add an extra parameter (flowexecutionkey) for possible requests created in a web application (links and forms) in order to indicate the active flow. Thanks to this new interface this parameter could be added in a trasparent and automatic way for programmers.
In fact, this functionality is included nowadays in the HDIV version for Spring MVC.
Affects: 3.0.6
Attachments:
- FormTag.java (14.42 kB)
- HiddenInputTag.java (1.35 kB)
- mvc-showcase-spr-7943.zip (474.38 kB)
- ParameterProcessing.java (3.10 kB)
- spring-webmvc-spr-7943.zip (40.07 kB)
7 votes, 8 watchers