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, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to