• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can EJB invoke Servlets/JSP?  RSS feed

 
Victor Htet
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We normally invoke EJBs from Servlets/JSPs, right?
I want to know that is it possible to invoke Servlet/JSPs from EJB.
One solution might be to use DAO that will use java.net.HttpURLConnection object to connect to Servlet, right?
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it should be possible, but I admit I have
never tried.
Wouldn't you be better served by creating a bean for
the code which both the EJB and the servlet/JSP
require? Each can then load and execute that code
locally without the HttpURLConnection overhead.
 
raj sekhar
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to parse the output of a servelt/JSP from an EJB? That sure will be perf issue and I guess a poor design
Raj
 
Victor Htet
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I'm trying to do is to get the NASDAQ stock quote from EJB.
Actually, I got that idea from IBM WebServices toolkit tutorial.
If you type "http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=MSFT" in the browser, you will see XML output for Microsoft stock from NASDAQ.
I am thinking to apply that logic to EJB. But just haven't had a chance. Will tell you when I get the result.
Thanks,
Victor

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!