How ejp aplication communicate with jsp or servlet

Questions by vemodharak   answers by vemodharak

Showing Answers 1 - 2 of 2 Answers

ArulJothi

  • Sep 18th, 2005
 

JSP or Servlet can communicate with EJB by giving the jndi name of that EnterpriseJavaBean in the lookup method of InitialContext.It will return a reference for the home interface of EJB.

  Was this answer useful?  Yes

Tamil Selvan

  • May 28th, 2007
 

To access a servlet/jsp from EJB create a URL and call its openStream() method.

URL google = new URL("http://www.google.com/");
BufferedReader in = new BufferedReader(new InputStreamReader(google.openStream()));

String inputLine;

while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);

in.close();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions