Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: Problems using jsp:useBean


Message #1 by "Alfian" <alfianhadi@s...> on Wed, 27 Mar 2002 16:55:38 +0700
HI

I think that when u put useBean u must take it from the session, that is u
have to put it at the Servlet side by example  session.setAttribute("cust1",
the object instance of CustomerBean)

this form the CustomerBean object have persistence to be take for the Jsp


Julio Oliveira



-----Mensaje original-----
De: Alfian [mailto:alfianhadi@s...]
Enviado el: Miércoles, 27 de Marzo de 2002 06:56 a.m.
Para: Servlets
Asunto: [servlets] Problems using jsp:useBean


Hi, all

I am having problems calling a bean through my JSP page. Below is the code:

<%@ page import = "com.seatech.Customer.CustomerBean" %>
<jsp:useBean id="cust1" class="CustomerBean" />

Tomcat throws error 500 : Cannot create bean of class CustomerBean.


However, if I call the bean with this method below, it works just fine.

<%@ page import = "com.seatech.Customer.CustomerBean" %>
<% CustomerBean cust1 = new CustomerBean(); %>

Are there any differences calling the bean with the two methods above ? Why
does the first one not work ?

BTW, I am using Tomcat 3.5.3. Thanks.


- Alfian -





  Return to Index