Hi everyone, 
   Is there a way to inject a page into a service via InjectPage annotation?

I am trying the following and does not seem to work:

package com.myapp.services;
public class MyServiceImpl implements MyService
{

@InjectPage
private Login loginPage;

  public Object consumer()
{
  loginPage.getLoginForm().recordError("too-soon-change-email");
  return loginPage;
}
...
}


So, myPage get's MyService injected and calls consumer() method. When
consumer() tries to  getLoginForm() is throws null pointer. 
=======================================
I also tried passing to the service consumer() method a loginPage instance
injected in "myPage" as an argument, like this:

public MyPage
{
@InjectPage
private Login loginPage;

@Inject
private MyService worker;

onActivate()
{
  worker.consume(workToBeDone, loginPage);
}

}

In this case I get a more "exotic" error. 


Any ideas how I could make use of a page in a service? 


Thanks very much, 
Bogdan. 





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/InjectPage-into-a-service-tp5713950.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

Reply via email to