Hans Bergsten, author of JavaServer Pages in its paper "Hans's Top Ten JSP
Tips" (google it for URL)
wrote:

>>>>

Using Packages for Bean Classes

When you develop a bean to be used in a JSP page, I recommend that you make
it part
of a named package. A Java class that does not use a package statement ends
up in the
so-called unnamed package. The servlet class generated from the JSP page is,
however,
typically assigned to a named package. If you try to refer to a class in the
unnamed
package from a class in a named package, Java cannot find the class unless
you use an
import statement to import it. In a JSP page that means you must use both a
page
directive to import the class, and the <jsp:useBean> action to make it
available:

<%@ page import="UserInfoBean" %>
<jsp:useBean id="userInfo" class="UserInfoBean" />

<<<<

it seems it does not work anymore with Tomcat 4.1.9:

F:\Tomcat 4.1.9\work\Standalone\localhost\ecomm\contact_jsp.java:11: '.'
expected
import UserInfoBean;
                          ^

How to write it now if I don't want my beans in a package?

NiS.

N i c o l a s   S i l b e r z a h n

<100% Java, Mobile, Offline aware>Wapaka Browser for mobile development
(XHTML, WML)</100% Java, Mobile, Offline aware> www.Wapaka.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to