I was using the 5.03. I just changed for the 5.04 then I tried your
proposition :

"No service implements the interface papo.ioc.services.UserService."

But my implementation, UserServiceImpl is in the same package than its
interface UserService and implements it.
The module UserModule that contains the buildUserService method and return
the UserService is also in this package...

What did I miss??


2007/5/29, Davor Hrg <[EMAIL PROTECTED]>:

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?
>

Reply via email to