Hi,
try with import:
<%@ page import="..."%>
with the name of your bean class.
Bye
----- Mensaje Original -----
De: "Jay H. Lang" <[EMAIL PROTECTED]>
Fecha: Lunes, Noviembre 27, 2000 10:41 pm
Asunto: JSP Error
> I have created a simple Java Bean, and a JSP that uses this bean.
> I am
> getting
> an error when using the bean and I cannot figure it out. I have
> included the JSP, the Bean and the error.
>
> Any help would be appreciated.
> Thanks.
>
> My JSP Page:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
> <!-- A JSP page using a Java Bean -->
> <HTML><HEAD>
>
> <META name="GENERATOR" content="IBM WebSphere Page Designer V3.0.2 for
> Windows">
> <META http-equiv="Content-Style-Type" content="text/css"><TITLE>This
> page is just to test a JSP to a Java Bean</TITLE>
> </HEAD><BODY>
> <jsp:useBean id="myBean" class="JayBean" scope="request">
> </jsp:useBean>
> <H1> My Name is: <jsp:getProperty name="myBean"
> property="FirstName" />
> </H1>
> </BODY></HTML>
>
>
>
> My Java Bean:
>
> //-----------------------------------------------------------------
> -------------
>
> // Owner: Jay H. Lang
> //
> // Class: JayBean
> //-----------------------------------------------------------------
> -------------
>
> import java.lang.*;
> import java.util.*;
>
> /**
> * This is a sample JavaBean. It has the following properties:
> * firstName, lastName, age, address, city, state, zip
> */
>
> public class JayBean extends java.lang.Object implements
> java.io.Serializable
> {
>
> /**
> * Instance variable for the address property
> */
> protected String address = null;
> /**
> * Instance variable for the city property
> */
> protected String city = null;
> /**
> * Instance variable for the state property
> */
> protected String state = null;
> /**
> * Instance variable for the zip property
> */
> protected String zip = null;
> /**
> * Instance variable for the phone property
> */
> protected String phone = null;
> /**
> * Instance variable for the age property
> */
> protected int age;
> /**
> * Instance variable for the firstName property
> */
> protected String firstName = "Jay";
> /**
> * Instance variable for the lastName property
> */
> protected String lastName = null;
>
>
> /*********************************************************************
********
>
> * Get method for the address property
> *
> * @return the value of the property
> */
> public String getAddress()
> {
> return address;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the address property
> *
> * @param value the new value for the property
> */
> public void setAddress(String value)
> {
> this.address = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the city property
> *
> * @return the value of the property
> */
> public String getCity()
> {
> return city;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the city property
> *
> * @param value the new value for the property
> */
> public void setCity(String value)
> {
> this.city = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the state property
> *
> * @return the value of the property
> */
> public String getState()
> {
> return state;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the state property
> *
> * @param value the new value for the property
> */
> public void setState(String value)
> {
> this.state = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the zip property
> *
> * @return the value of the property
> */
> public String getZip()
> {
> return zip;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the zip property
> *
> * @param value the new value for the property
> */
> public void setZip(String value)
> {
> this.zip = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the phone property
> *
> * @return the value of the property
> */
> public String getPhone()
> {
> return phone;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the phone property
> *
> * @param value the new value for the property
> */
> public void setPhone(String value)
> {
> this.phone = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the age property
> *
> * @return the value of the property
> */
> public int getAge()
> {
> return age;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the age property
> *
> * @param value the new value for the property
> */
> public void setAge(int value)
> {
> this.age = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the firstName property
> *
> * @return the value of the property
> */
> public String getFirstName()
> {
> return firstName;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the firstName property
> *
> * @param value the new value for the property
> */
> public void setFirstName(String value)
> {
> this.firstName = value;
> }
>
>
> /*********************************************************************
********
>
> * Get method for the lastName property
> *
> * @return the value of the property
> */
> public String getLastName()
> {
> return lastName;
> }
>
>
> /*********************************************************************
********
>
> * Set method for the lastName property
> *
> * @param value the new value for the property
> */
> public void setLastName(String value)
> {
> this.lastName = value;
> }
>
>
> }
>
>
>
> The bean is located in the directory:
> /usps/develop/stlouis/IA/was/beans
> The
>
deployedwebapp.int.classpath=/usps/develop/stlouis/IA/was/servlets:/usps
/develop/stlouis/IA/was/beans
>
>
>
>
> Here is the error:
>
> /tmp/WebSpherClass usps.develop.stlouis.IA.was.html.JayBean not
> found in type
> declaration.
> JayBean myBean = null;
> ^
> /tmp/WebSpherClass usps.develop.stlouis.IA.was.html.JayBean not
> found in type
> declaration.
> myBean= (JayBean)
> ^
> /tmp/WebSpherClass usps.develop.stlouis.IA.was.html.JayBean not
> found in type
> declaration.
> myBean = (JayBean)
> Beans.instantiate(getClassLoader(), "JayBean");
> ^
> Note:
> /usr/lpp/WebSpheruses a deprecated API. Recompile with "-
> deprecation" for details.
> 3 errors, 1 warning
>
> --
> Jay H. Lang
> Chief Technologist
> Distributed Computing Professionals Inc.
> IBM Certified Specialist - MQSeries
> 303 277-1873 - Office
> 303 807-9700 - Cell
>
>
========================================================================
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-
> INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
________________________________________________________________
Consigue tu cuenta gratuita de acceso a internet y de correo en
http://www.navegalia.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets