• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The import attribute of page directive not working for the entire translation unit

 
Bibhudutta Pradhan
Ranch Hand
Posts: 31
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
index.jsp
--------------
<%@ page import="com.MyClass" %>


<%@include file="included1.jsp" %>


included1.jsp
----------------
<% MyClass myclass = new MyClass(); %>


Exception:
MyClass cannot be resolved to a type


Why ?? I am reading "SCWCD Exam Study Kit". It says that :
"The page directive applies to the entire translation unit and not just to the page in which it is declared."
Please help. Thanks.
 
Ashok Kurakula
Greenhorn
Posts: 15
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that your class has a public access and your WEB-INF/classes has a proper directory structure.
 
Bibhudutta Pradhan
Ranch Hand
Posts: 31
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ashok.

Actually the classpath was not set from bin to classes.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic