struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Exposito <fcoexpos...@hotmail.com>
Subject Instance object with spring in struts2
Date Thu, 24 Sep 2009 09:55:28 GMT

Hello,

I've installed spring plugin fullhibernatecore plugin. Then I have defined in applicationContext


<bean id="countryService" class="com.virtua.market.service.dao.CountryDaoService"/>

Then I have an action class where I define (with getters and setters):

private ICountryService countryService;

And when the action happens it instances the countryService.


Also I have the same, but in a conversion class(public class CountryConversion extends StrutsTypeConverter),
and it works properly.

But I have another action where nothing happens. It maintains the variable=null. This new
class is a util class which I have to instantiate to execute its methods. Here is the class.

package com.virtua.market.util;

import java.util.List;

import com.virtua.market.service.interfaces.ICountryService;
import com.virtua.market.vo.Country;

public class ComboUtilPersistenceFunctions
{
    private ICountryService countryService;
    
    public List<Country> getCountries()
    {
        List<Country> countries=null;    
        countries = countryService.getAll();
        return countries;
    }

    public void setCountryService(ICountryService countryService)
    {
        this.countryService = countryService;
    }

    public ICountryService getCountryService()
    {
        return countryService;
    }    
}


Anybody knows what can I do?

Thanks in advance
 		 	   		  
_________________________________________________________________
Llévate Messenger en el móvil a todas partes ¡Conéctate!
http://www.microsoft.com/spain/windowsmobile/messenger/default.mspx
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message