fixed sample code (SPR-6687)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2813 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
17ebfdd6f1
commit
b695f63a0b
|
|
@ -264,7 +264,7 @@
|
|||
of code was executed against a
|
||||
<classname>ClassPathXmlApplicationContext</classname> instance:</para>
|
||||
|
||||
<programlisting language="java">Resource template = ctx.getResource("some/resource/path/myTemplate.txt);</programlisting>
|
||||
<programlisting language="java">Resource template = ctx.getResource("some/resource/path/myTemplate.txt");</programlisting>
|
||||
|
||||
<para>What would be returned would be a
|
||||
<classname>ClassPathResource</classname>; if the same method was executed
|
||||
|
|
@ -281,15 +281,15 @@
|
|||
application context type, by specifying the special
|
||||
<literal>classpath:</literal> prefix:</para>
|
||||
|
||||
<programlisting language="java">Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt);</programlisting>
|
||||
<programlisting language="java">Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt");</programlisting>
|
||||
|
||||
<para>Similarly, one can force a <classname>UrlResource</classname> to be
|
||||
used by specifying any of the standard <classname>java.net.URL</classname>
|
||||
prefixes:</para>
|
||||
|
||||
<programlisting language="java">Resource template = ctx.getResource("file:/some/resource/path/myTemplate.txt);</programlisting>
|
||||
<programlisting language="java">Resource template = ctx.getResource("file:/some/resource/path/myTemplate.txt");</programlisting>
|
||||
|
||||
<programlisting language="java">Resource template = ctx.getResource("http://myhost.com/resource/path/myTemplate.txt);</programlisting>
|
||||
<programlisting language="java">Resource template = ctx.getResource("http://myhost.com/resource/path/myTemplate.txt");</programlisting>
|
||||
|
||||
<para>The following table summarizes the strategy for converting
|
||||
<classname>String</classname>s to
|
||||
|
|
|
|||
Loading…
Reference in New Issue