Results 1 to 5 of 5

Thread: Setting an array of Strings

  1. #1
    Join Date
    Jul 2005
    Location
    Los Angeles, USA
    Posts
    25

    Default Setting an array of Strings

    Hi,

    I'm trying to set an array of strings as required by the TransactionProxyFactoryBean's proxyInterfaces property. Is that natively supported, or do I need to define my own PropertyEditor. I'm hoping for something like the List syntax.

    Code:
    <bean id="myProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
       ... other properties ...
       <property name="proxyInterfaces">
          <value>xyz.Interface1</value>
          <value>xyz.Interface2</value>
       </propery>
    </bean>
    - Paul

  2. #2
    Join Date
    Sep 2005
    Location
    Vienna
    Posts
    44

    Default

    Hi Paul,

    I would rather suggest:
    Code:
    ...
       <property name="proxyInterfaces">
          <list>
            <value>xyz.Interface1</value>
            <value>xyz.Interface2</value>
          </list>
       </property>
    ...
    See description in spring-beans.DTD.

    Erik

  3. #3
    Join Date
    Jul 2005
    Location
    Los Angeles, USA
    Posts
    25

    Default Setting an array of Strings

    Thanks, Erik. But wouldn't that only be valid for a List property? Or would that somehow be translated into a String[]?

    - Paul

  4. #4
    Join Date
    Jul 2005
    Location
    Los Angeles, USA
    Posts
    25

    Default Setting an array of Strings

    Hmm. Upon following the advice of checking out the spring-beans.DTD, I see that it does indeed indicate that it will be mapped to an array type.

    - Paul

  5. #5
    Join Date
    Sep 2005
    Location
    João Pessoa, Paraíba - Brazil
    Posts
    5

    Default

    If you're mapping to a String[] a comma separated list of values will work:

    Code:
    <bean id="myProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
       ... other properties ...
       <property name="proxyInterfaces">
          <value>xyz.Interface1,xyz.Interface2,xyz.Interface3</value>
       </propery>
    </bean>
    Coding: At the end of the day, if the program doesn\'t run and make money for the client, you haven\'t done anything.

Similar Threads

  1. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  2. JBoss DataSource not found
    By moacsjr in forum Data
    Replies: 10
    Last Post: Aug 25th, 2005, 01:26 PM
  3. Spring/Hibernate Delete/Update Problem
    By Noname in forum Data
    Replies: 4
    Last Post: Jun 15th, 2005, 11:07 PM
  4. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM
  5. Transaction Management
    By caverns in forum Data
    Replies: 3
    Last Post: Mar 8th, 2005, 06:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •