try: @Inject private UserService _userService; you haven't mentioned the version code above is for 5.0.4, I'm not sure for older versions
Davor Hrg On 5/29/07, Blackwings <[EMAIL PROTECTED]> wrote:
Hi, I think I'm not using correctly the tapestry-ioc since my page call itself my module to get the service implementation instance (as service): UserModule public class UserModule { public static UserService buildUserService() { return new UserServiceImpl(); } } UserService public interface UserService { public User getAuthenticatedUser(String login, String password) throws PapoException; } UserServiceImpl public class UserServiceImpl implements UserService { public User getAuthenticatedUser(String login, String password) throws PapoException { [code] return user; } } Start [code] private UserService _userService; String onSuccess() { [code here] _userService = UserModule.buildUserService(); _user = _userService.getAuthenticatedUser(_login.getLogin(), _login.getPassword()); ****** My page call itself the build method... so my page is hardly linked to the ioc but this is wrong. I thought about something like : [code] @InjectService("UserService") private UserService _userService; String onSuccess() { [code here] _user = _userService.getAuthenticatedUser(_login.getLogin(), _login.getPassword()); But it doesn't compile and the notation found in the documentaiton : @Inject @Service("UserService") doesn't exist anymore in the tapestry-core... Any idea?