I am using a stateless session bean to query data from the database. The method on server executes properly but I am not getting data displayed in
JSP. Method getQuestion executes fine on server but System.out.println (very next line) of JSP is never executed. Can anyone suggest? The sample code is :
<%
J2eeQuiz quiz = null;
try {
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/neha/quiz/TheQuiz");
J2eeQuizHome home = (J2eeQuizHome)PortableRemoteObject.narrow(
objRef, J2eeQuizHome.class);
quiz = home.create();
} catch (RemoteException ex) {
System.out.println("Couldn't create quiz bean."+ ex.getMessage());
} catch (CreateException ex) {
System.out.println("Couldn't create quiz bean."+ ex.getMessage());
} catch (NamingException ex) {
System.out.println("Unable to lookup home: "+ "TheQuiz "+ ex.getMessage());
}
Question[] questions = quiz.getQuestions(5);
System.out.println("Testing"+(questions==null ? " NULL" : "LEN"));
session.setAttribute("quest", questions);
..
..