I'm not sure what you mean by the service Id, but I use Spring with Tap5 like 
this:

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:context="http://www.springframework.org/schema/context";
       xmlns:tx="http://www.springframework.org/schema/tx";
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context.xsd
           http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd";
        default-autowire="byName" >

   <!-- notice I use default-autowire byName -->

    <!-- data source -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
destroy-method="close">
        <property name="driverClassName" value="${dataSource.driverClass}" />
        <property name="username" value="${dataSource.user}" />
        <property name="password" value="${dataSource.password}" />
        <property name="url" value="${dataSource.jdbcURL}" />
    </bean>

    <!-- Hibernate session factory -->
    <bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="configLocation" value="classpath:/hibernate.cfg.xml"/>
    </bean>

    <!-- Hibernate transaction manager -->
    <bean id="transactionManager"
          
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

   <!-- 
          scan these packages, business classes are marked with @Service.
          DAOs are marked with @Component
     -->
    <context:component-scan base-package="com.starpoint.helpdesk.business" />
    <context:component-scan base-package="com.starpoint.helpdesk.dao" />

    <context:annotation-config/>

    <tx:annotation-driven transaction-manager="transactionManager" />

</beans>

Then in my TestNG cases I can simply Inject using the Spring annotation:

    @Autowired
    EmailGroupLogic emailGroupLogic;

In my actual code, I use Tapestry to Inject the services like this:

    @Inject
    private UserLogic userLogic;

I'm sure there is probably a way to get Tapestry to @Inject in test cases, but 
I couldn't get anything to play ball and this was sufficient for my needs.

-Tony

On Jul 6, 2011, at 7:26 AM, dick_hu wrote:

> Anyone can tell me,how can I get the serviceId from spring Integration?
> I try in my test,I Integrate a bean named "TestService" in spring xml, but I
> can't get the service in my Page by @InjectService("TestService").
> I want to catch the serviceId from spring bean,what can I do?
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/a-question-T5-work-with-spring-tp4556498p4556498.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to