• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCWCDExamStudyKit - Somebody Explain this...Please

 
Madan, Gopal
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run the chapter14 webapp examples where it uses the AddressBean class. I am getting the following exception, ( and then some cuz of this ) which i quote. Can somebody explain what's happening.

org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /address.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat 4.1\work\Standalone\localhost\chapter14\address_jsp.java:7: '.' expected
import AddressBean;
 
boyet silverio
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Gopal,
I'll just try since I don't know the book you're referring to. Based on the quote you posted, you have an AddressBean class which was used in an address.jsp file (as stated in the ...\address_jsp.java servlet translation). The error says that the container, which is tomcat version 4.1, is looking for a '.' in import AddressBean.
I met a similar javabean problem with the newer versions of tomcat (4.1.x). It seems that the newer tomcat expects to use 'import' for packaged javabeans or classes. (i.e. '.' expected import AddressBean; ) . You could remedy that by packageing your AddressBean (e.g.
com.AddressBean) before using it in your jsp.
[ February 11, 2003: Message edited by: boyet silverio ]
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3820
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you do not specify a package for a class, the new version of Tomcat assumes the package as its own default package, which is org.apache.something. Imns about the exact name. This is different from Java's default package. That's why it does not find the class within that package.
You can download the updated source code for the examples from JDiscuss.com. They have been updated to reflect these changes in Tomcat 4.0.x to 4.1.x
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic