Hi,

I've a problem. I'm using a page which has an actionlink like this:

<a t:type="actionlink" t:id="alid">Link Text</a>

And i've an @OnEvent handler in my Page Class, as follows:

@OnEvent(component="alid")
void function() {
 DBConnect db = new DBConnect();
System.out.println(db.getLine());
}

Till, this i've no problem. I've an object called DBConnect which has the
class as follows:

public class DBConnect {
 @Inject
 Session _session;

 public String getLine() {
*  List _news = _session.createCriteria(RNews.class).list();*
  return _news.getText();
 }
}

When i run the actionlink, i get an NullPointer Exception at the bolder line
above (at the _session.createCriteria(RNews.class).list()).. Why does this
happen? Isn't this mean, @Inject is not working, hence the _session is not
initialized??

 - Ashwanth Kumar

Reply via email to