Issue 1:
Josef Vychtrle opened SPR-8601 and commented

There are two major means of data binding initialization, but there is a drawback in the oldschool xml one.

In short, you can do this :

@InitBinder("order")
public void initBinder(WebDataBinder binder) {
binder.setAllowedFields(allowedFields.split(","));
}

but it can't be done with ConfigurableWebBindingInitializer. First off, the binder instance is created in AnnotationMethodHandlerAdapter and initializer is passed the binder instance somewhere in HandlerMethodInvoker so it can't be set up... :

<bean id="webBindingInitializer" class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
<property name="messageCodesResolver" ref="codesResolver" />
<!-- missing allowed / disallowed / required properties -->
</bean>

FIX :

public void initBinder(WebDataBinder binder, WebRequest request) {
if(this.allowedFields != null) {
binder.setAllowedFields(allowedFields);
}
if(this.disallowedFields != null) {
binder.setDisallowedFields(disallowedFields);
}
if(this.allowedFields != null) {
binder.setRequiredFields(requiredFields);
}
if (this.directFieldAccess) {
binder.initDirectFieldAccess();
}
if (this.messageCodesResolver != null) {
binder.setMessageCodesResolver(this.messageCodesResolver);
}
if (this.bindingErrorProcessor != null) {
binder.setBindingErrorProcessor(this.bindingErrorProcessor);
}
if (this.validator != null && binder.getTarget() != null &&
this.validator.supports(binder.getTarget().getClass())) {
binder.setValidator(this.validator);
}
if (this.conversionService != null) {
binder.setConversionService(this.conversionService);
}
if (this.propertyEditorRegistrars != null) {
for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) {
propertyEditorRegistrar.registerCustomEditors(binder);
}
}
}

Affects: 3.1 M2

Issue Links:

#13244 ConfigurableWebBindingInitializer should have allowed / disallowed / required fields for DataBinder initialization ("duplicates")

Issue 2:
Peter Mularien opened SPR-3695 and commented

A very common issue with new adopters of Spring MVC is confusion over how to get JSTL working in their application server. Although the Spring docs can't possibly cover every application server, since I try to help out newbies on the forums, I've noticed a few common problems/pitfalls that might be worthwhile to document in section 14.2 of the documentation.

The basis for some of this is that for a lot of people, when using Spring MVC, they are also attempting to use JSTL for the first time. So although some of the blame for these common issues falls on Sun, I think it would be worthwhile to cover some of them in the Spring docs, because people ultimately come to the Spring Web forums to get them solved (thinking that they are Spring problems).

Here's a few suggestions, feel free to document some or all of them.

The most common problem is people trying to use JSTL without declaring their web application as a servlet 2.4 (or higher) web app. In compliant application servers (most commonly reported is Tomcat), this will disable JSTL 2.0 evaluation. The documentation should provide an example web.xml snippet illustrating where the webapp version is set, and indicate the minimum required version to get JSTL 2.0 evaluation (a list of app servers supporting this would be nice, too ;) ).

There are many, many threads in the Spring Web forum regarding this confusion. Do a search with the terms "+jstl +version". Examples:

http://forum.springframework.org/showthread.php?t=35085&highlight=jstl+version

http://forum.springframework.org/showthread.php?t=38850&highlight=jstl+version

http://forum.springframework.org/showthread.php?t=27858&highlight=jstl+version

... etc.

Another common problem is people being confused over which JSTL taglib declaration to use, and how to reference JSTL within the page.

More documentation on how to set up JSTL with MessageSourceAccessors, along with an example.

I can't think of anything else at the moment, but I'd suggest reviewing some of the recent forum postings for ideas on additional topics. I always found it kind of odd that the documentation for how to use Spring with FreeMarker is more dense than the docs for Spring + JSP/JSTL :)

Part of the problem (I think) is that the only MVC tutorial that's on the web site (step-by-step) is extremely outdated. It would be great if we could put together an example that is as simple, while being updated for Spring 2.x (but that's the topic of another JIRA).

Let me know if I can help at all with this effort.

Affects: 2.0.6

Referenced from: commits 89d997a

4 votes, 5 watchers