Hi,
I'm in need to make some JSP's to talk to EJB's, can anyone help by exploring in detail?
Thanks in advance
Devendra
-
How JSP can talk to EJB? (4 messages)
- Posted by: Devendra Gupta
- Posted on: August 06 2000 11:16 EDT
Threaded Messages (4)
- How JSP can talk to EJB? by Zhihong Zou on August 07 2000 16:01 EDT
- How JSP can talk to EJB? by chris bono on August 08 2000 10:22 EDT
-
How JSP can talk to EJB? by Frank Villarreal on August 08 2000 12:44 EDT
- How JSP can talk to EJB? by christine woods on August 10 2000 09:55 EDT
-
How JSP can talk to EJB? by Frank Villarreal on August 08 2000 12:44 EDT
- How JSP can talk to EJB? by chris bono on August 08 2000 10:22 EDT
-
How JSP can talk to EJB?[ Go to top ]
- Posted by: Zhihong Zou
- Posted on: August 07 2000 16:01 EDT
- in response to Devendra Gupta
Hi, there, check out Sun'2 J2EE document, Java 2
Exterprise Edition Developer Guide. There is one
JSP-EJB example in Chapter 7. Hope that will help.
Zhihong -
How JSP can talk to EJB?[ Go to top ]
- Posted by: chris bono
- Posted on: August 08 2000 10:22 EDT
- in response to Zhihong Zou
Devendra,
Just make a java bean ( a facade to the EJB ) that will lookup the home via JNDI and then create the EJB. Just use this bean in the JSP to access your EJB.
Chris -
How JSP can talk to EJB?[ Go to top ]
- Posted by: Frank Villarreal
- Posted on: August 08 2000 12:44 EDT
- in response to chris bono
Hi,
How do you pass the reference of the EJB object to another JSP page? What is considered good practice? Would you store the home object in a session variable?
Thanks in advance! -
How JSP can talk to EJB?[ Go to top ]
- Posted by: christine woods
- Posted on: August 10 2000 21:55 EDT
- in response to Frank Villarreal
One way to pass the reference is (using an example of an account object in a servlet):
if (account != null)
{
template = "/jsp/Member/Account.jsp";
request.setAttribute("Account", account);
//Process the template.
RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher(template);
requestDispatcher.forward(request, response);
}
Then reference the account object in the jsp file:
<%@ page import = "java.lang.String,java.text.*,java.util.*,com.path.Account" %>
<% Account account = (Account) request.getAttribute("Account"); %>