• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I call an EJB directly from JSP Using Suns J2EE Server?

 
Rob Weintraub
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Weblogic, I can access an EJB directly from a "standalone" JSP page. But with the J2ee Server I downloaded from Sun, I did not see any examples showing this. The examples show the JSP being added to the application .ear file and using a java bean to access the EJB. This seems like a lot of extra work. Is this the only way it will work?
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From personal experience, I can tell you that JSPs accessing EJBs directly can be pretty ugly. Since JSP's don't (yet) have an equivalent mechanism to the <useBean> JavaBean tag you can end up embedding a lot of Java code in the JSP. Much cleaner to move the code into a code module (model controller) and leave the JSP to handle the view.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!