<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=ben_hutchison" rel="nofollow">Ben Hutchison</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-230?redirect=false" rel="nofollow">SPR-230</a></strong>* and commented</p>
<p dir="auto">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.</p>
<p dir="auto">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.</p>
<p dir="auto">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:</p>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br>
&lt;java version="1.4.2_03" class="java.beans.XMLDecoder"&gt;<br>
&lt;object class="java.util.ArrayList"&gt;<br>
&lt;void method="add"&gt;<br>
&lt;string&gt;item&lt;/string&gt;<br>
&lt;/void&gt;<br>
&lt;/object&gt;<br>
&lt;/java&gt;</p>
<p dir="auto">Evidently, it was recognized as an important feature as its present from the first release of the peristence mechanism.</p>
<p dir="auto">Consider what is <strong>not</strong> readily doable from XML without this feature:</p>
<ul dir="auto">
<li>Cannot create any Swing component heirarchies.</li>
<li>Cannot initialize custom collections (ie anything not a vanilla set/map/list impl), unless it provides a copy-constructor.</li>
<li>Cannot init arbritrary state on objects which do not observe the get/setXXX convention (and legacy code is littered with them).</li>
</ul>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.0.2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/15243/SPR-230.patch" rel="nofollow">SPR-230.patch</a> (<em>137.30 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398070077" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7195" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7195/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7195">#7195</a> Allow setting of properties without a javabean setter (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398070258" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7222" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7222/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7222">#7222</a> Support JavaBean Eventing methods in Spring (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398072522" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7488" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7488/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7488">#7488</a> "adder" injection in addition to "setter" (invoke addXX() instead of setXX()) (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398057408" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/5727" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/5727/hovercard" href="https://github.com/spring-projects/spring-framework/issues/5727">#5727</a> support "add"-style List injection (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">32 votes, 28 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=moores" rel="nofollow">Michael Moores</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7818?redirect=false" rel="nofollow">SPR-7818</a></strong> and commented</p>
<p dir="auto">We are trying to use semicolon as the delimiter in a list of values being passed into<br>
a <code class="notranslate">@Controller</code>.  It looks like the URI data is truncated after the semicolon.<br>
Using a comma as the delimiter works fine, but semicolon is broke.  I think semicolon is legal.</p>
<p dir="auto">I have a controller that looks like this:</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@Controller(value=&quot;controller2&quot;) 
public class ProfileController2 {

    @RequestMapping(method = GET, value = &quot;/users/{guid}/{p1};{p2}/xyz&quot;)
    @ResponseBody
    public ResponseEntity&lt;String&gt; getProfile2(
            @PathVariable(&quot;guid&quot;) final String guid, 
            @PathVariable(&quot;p1&quot;) final String p1, 
            @PathVariable(&quot;p2&quot;) final String p2) {
           
        log.info(&quot;get:guid/p1/p2:&quot; + guid + &quot;/&quot; + p1 + &quot;/&quot; + p2) ;             
        ResponseEntity&lt;String&gt; responseEntity = new ResponseEntity&lt;String&gt;(guid + &quot;/&quot; + p1 + &quot;/&quot; + p2, HttpStatus.OK); 
        return responseEntity;
    }
}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">Controller</span>(<span class="pl-s1">value</span>=<span class="pl-s">"controller2"</span>) 
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">ProfileController2</span> {

    <span class="pl-c1">@</span><span class="pl-c1">RequestMapping</span>(<span class="pl-s1">method</span> = <span class="pl-c1">GET</span>, <span class="pl-s1">value</span> = <span class="pl-s">"/users/{guid}/{p1};{p2}/xyz"</span>)
    <span class="pl-c1">@</span><span class="pl-c1">ResponseBody</span>
    <span class="pl-k">public</span> <span class="pl-smi">ResponseEntity</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-en">getProfile2</span>(
            <span class="pl-c1">@</span><span class="pl-c1">PathVariable</span>(<span class="pl-s">"guid"</span>) <span class="pl-k">final</span> <span class="pl-smi">String</span> <span class="pl-s1">guid</span>, 
            <span class="pl-c1">@</span><span class="pl-c1">PathVariable</span>(<span class="pl-s">"p1"</span>) <span class="pl-k">final</span> <span class="pl-smi">String</span> <span class="pl-s1">p1</span>, 
            <span class="pl-c1">@</span><span class="pl-c1">PathVariable</span>(<span class="pl-s">"p2"</span>) <span class="pl-k">final</span> <span class="pl-smi">String</span> <span class="pl-s1">p2</span>) {
           
        <span class="pl-s1">log</span>.<span class="pl-en">info</span>(<span class="pl-s">"get:guid/p1/p2:"</span> + <span class="pl-s1">guid</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">p1</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">p2</span>) ;             
        <span class="pl-smi">ResponseEntity</span>&lt;<span class="pl-smi">String</span>&gt; <span class="pl-s1">responseEntity</span> = <span class="pl-k">new</span> <span class="pl-smi">ResponseEntity</span>&lt;<span class="pl-smi">String</span>&gt;(<span class="pl-s1">guid</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">p1</span> + <span class="pl-s">"/"</span> + <span class="pl-s1">p2</span>, <span class="pl-smi">HttpStatus</span>.<span class="pl-c1">OK</span>); 
        <span class="pl-k">return</span> <span class="pl-s1">responseEntity</span>;
    }
}</pre></div>
<p dir="auto">Here is the debug log output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(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]"><pre class="notranslate"><code class="notranslate">(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]
</code></pre></div>
<p dir="auto">The same thing happens if i use a List as the <code class="notranslate">@PathVariable</code> type, passing in a string of semicolon delimited values as one input variable.  The data after the semicolon is lost.</p>
<p dir="auto">When I look at the RFC, it looks like the semicolon should be supported, right?</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.5</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=99477" rel="nofollow">http://forum.springsource.org/showthread.php?t=99477</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398093307" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10171" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10171/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10171">#10171</a> Support for matrix parameters (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/2201dd8c45051230ad1a5a0e895cb5951edbfb74/hovercard" href="https://github.com/spring-projects/spring-framework/commit/2201dd8c45051230ad1a5a0e895cb5951edbfb74"><tt>2201dd8</tt></a></p>