Issue 1:
Ben Hutchison opened SPR-230* and commented

Objects that contain other objects (common examples include Swing Containers and the Collections classes) frequently cannot have their initial state specified through setting javabeans properties alone.

This is a request for the spring core to include extensions to the syntax of the applicationContext.xml to allow such objects to be setup completely from XML. Some reasonably conveinient syntax is needed that allows methods like "add()" to be invoked on the bean at construction time. Ideally, I think the syntax should allow any arbritrary methods to be called on a bean during preparation.

There is a clear precendent to be found in the design of the java.beans.XMLEncoder/Decoder classes, designed to support long term bean perisstence. Consider the extract below generated by XML-serializing a List:

<?xml version="1.0" encoding="UTF-8" ?>

<java version="1.4.2_03" class="java.beans.XMLDecoder">

<object class="java.util.ArrayList">

<void method="add">

<string>item</string>

</void>

</object>

</java>

Evidently, it was recognized as an important feature as its present from the first release of the peristence mechanism.

Consider what is not readily doable from XML without this feature:

Cannot create any Swing component heirarchies.

Cannot initialize custom collections (ie anything not a vanilla set/map/list impl), unless it provides a copy-constructor.

Cannot init arbritrary state on objects which do not observe the get/setXXX convention (and legacy code is littered with them).

Affects: 1.0.2

Attachments:

SPR-230.patch (137.30 kB)

Issue Links:

#7195 Allow setting of properties without a javabean setter ("is duplicated by")

#7222 Support JavaBean Eventing methods in Spring ("is duplicated by")

#7488 "adder" injection in addition to "setter" (invoke addXX() instead of setXX()) ("is duplicated by")

#5727 support "add"-style List injection ("is duplicated by")

32 votes, 28 watchers

Issue 2:
Michael Moores opened SPR-7818 and commented

We are trying to use semicolon as the delimiter in a list of values being passed into

a @Controller. It looks like the URI data is truncated after the semicolon.

Using a comma as the delimiter works fine, but semicolon is broke. I think semicolon is legal.

I have a controller that looks like this:

@Controller(value="controller2")
public class ProfileController2 {

@RequestMapping(method = GET, value = "/users/{guid}/{p1};{p2}/xyz")
@ResponseBody
public ResponseEntity<String> getProfile2(
@PathVariable("guid") final String guid,
@PathVariable("p1") final String p1,
@PathVariable("p2") final String p2) {

log.info("get:guid/p1/p2:" + guid + "/" + p1 + "/" + p2) ;
ResponseEntity<String> responseEntity = new ResponseEntity<String>(guid + "/" + p1 + "/" + p2, HttpStatus.OK);
return responseEntity;
}
}

Here is the debug log output:

(initialization)
2010-12-13 13:06:20,033 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] (ContainerBackgroundProcessor[StandardEngine[Catalina]]:) - Returning cached instance of singleton bean 'controller2'
2010-12-13 13:06:20,033 INFO [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] (ContainerBackgroundProcessor[StandardEngine[Catalina]]:) - Mapped URL path [/users/{guid}/{p1};{p2}/xyz] onto handler 'controller2'

(actual request processing)
2010-12-13 13:06:25,109 DEBUG [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping] (http-8098-1-ReqId:PNNnECYWSw66Mwb4w9E17g:) - No handler mapping found for [/users/guid123/P1]
2010-12-13 13:06:25,121 WARN [org.springframework.web.servlet.PageNotFound] (http-8098-1-ReqId:PNNnECYWSw66Mwb4w9E17g:) - No mapping found for HTTP request with URI [/profile/users/guid123/P1] in DispatcherServlet with name 'profile'
2010-12-13 13:06:25,121 INFO [com.real.uds.common.framework.exception.StandardErrorResponderBean] (http-8098-1-ReqId:PNNnECYWSw66Mwb4w9E17g:) - Error response status code 404 and error code InvalidRequest; the error message is No mapping found for HTTP r
equest with URI [/profile/users/guid123/P1] in DispatcherServlet with name 'profile'
2010-12-13 13:06:25,152 DEBUG [org.springframework.web.context.support.XmlWebApplicationContext] (http-8098-1-ReqId:PNNnECYWSw66Mwb4w9E17g:) - Publishing event in WebApplicationContext for namespace 'profile-servlet': ServletRequestHandledEvent: url=[/profile/users/guid123/P1;P2/xyz]; client=[127.0.0.1]; method=[GET]; servlet=[profile]; session=[null]; user=[null]; time=[69ms]; status=[OK]

The same thing happens if i use a List as the @PathVariable type, passing in a string of semicolon delimited values as one input variable. The data after the semicolon is lost.

When I look at the RFC, it looks like the semicolon should be supported, right?

Affects: 3.0.5

Reference URL: http://forum.springsource.org/showthread.php?t=99477

Issue Links:

#10171 Support for matrix parameters ("duplicates")

Referenced from: commits 2201dd8