struts-user mailing list archives

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


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

<bean id="countryService" class=""/>

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.


import java.util.List;


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!
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message