From: Rick E. <spr...@us...> - 2006-04-21 11:31:50
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19110/docs/reference/src Modified Files: xsd-configuration.xml Log Message: [SPR-1907] Documented the <jndi:xxx/> tags. Index: xsd-configuration.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/xsd-configuration.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** xsd-configuration.xml 21 Apr 2006 11:10:47 -0000 1.3 --- xsd-configuration.xml 21 Apr 2006 11:31:44 -0000 1.4 *************** *** 97,101 **** the following preamble at the top of one's Spring XML configuration file; the emboldened text in the following snippet references the correct schema so that ! the tags in the <literal>util</literal> are available to you.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" --- 97,101 ---- the following preamble at the top of one's Spring XML configuration file; the emboldened text in the following snippet references the correct schema so that ! the tags in the <literal>util</literal> namespace are available to you.</para> <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" *************** *** 272,275 **** --- 272,358 ---- </section> </section> + <section id="xsd-config-body-schemas-jndi"> + <title>The <literal>jndi</literal> schema</title> + <para>The <literal>jndi</literal> tags deal with JNDI-related configuration issues, + such as looking up a JNDI object. + </para> + <para>To use the tags in the <literal>jndi</literal> schema, one needs to have + the following preamble at the top of one's Spring XML configuration file; + the emboldened text in the following snippet references the correct schema so that + the tags in the <literal>jndi</literal> namespace are available to you.</para> + <programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?> + <beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + ]]><emphasis role="bold">xmlns:jndi="http://www.springframework.org/schema/jndi"</emphasis><![CDATA[ + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + ]]><emphasis role="bold">http://www.springframework.org/schema/jndi http://www.springframework.org/schema/jndi/spring-jndi.xsd"</emphasis><![CDATA[> + + ]]><lineannotation><!-- <literal><bean/></literal> definitions here --></lineannotation><![CDATA[ + + </beans>]]></programlisting> + <section> + <title><literal><jndi:lookup/></literal> (simple)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"/>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (with JNDI environment setting)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="jndiEnvironment"> + <props> + <prop key="foo">bar</prop> + </props> + </property> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"> + <jndi:environment>foo=bar</jndi:environment> + </jndi:lookup>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (with JNDI environment settings)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="jndiEnvironment"> + <props> + <prop key="foo">bar</prop> + <prop key="ping">pong</prop> + </props> + </property> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" jndi-name="jdbc/MyDataSource"> + <jndi:environment>foo=bar</jndi:environment> + <jndi:environment>ping=pong</jndi:environment> + </jndi:lookup>]]></programlisting> + </section> + <section> + <title><literal><jndi:lookup/></literal> (complex)</title> + <para>Before...</para> + <programlisting><![CDATA[<bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> + <property name="jndiName" value="jdbc/MyDataSource"/> + <property name="cache" value="true"/> + <property name="resourceRef" value="true"/> + <property name="lookupOnStartup" value="false"/> + <property name="expectedType" value="com.myapp.DefaultFoo"/> + <property name="proxyInterface" value="com.myapp.Foo"/> + </bean>]]></programlisting> + <para>After...</para> + <programlisting><![CDATA[<jndi:lookup id="simple" + jndi-name="jdbc/MyDataSource" + cache="true" + resource-ref="true" + lookup-on-startup="false" + expected-type="com.myapp.DefaultFoo" + proxy-interface="com.myapp.Foo"/>]]></programlisting> + </section> + </section> </section> <section id="xsd-config-setup"> |