Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 31
Hibernate Spring Java
  • 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.
 
Greenhorn
Posts: 15
Eclipse IDE Tomcat Server Java
  • 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 Spring Java
  • 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.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic