Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

problem for all ..

 
Ranch Hand
Posts: 5390
1
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I have a web-app directory struture like ..

In folder Folder02 you have a JSP page, let us say page01.jsp
Now that page01 wants to access a class MyClass which has a default package(i.e no package name).
Where you should put MyClass.class file so that page01 can access this class?
Himt : what will be the import attribute of page directive? (I got a way to around the problem)
so ... your times start NOW ..
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should put your classes in WEB-INF/classes. If you have any jars, they should be in WEB-INF/lib.
In your case, the page01.jsp should include the following line.
<%@ page import="MyClass" %>
then you can access MyClass, e.g.
<jsp:useBean id="myCls" class="MyClass" />
 
R K Singh
Ranch Hand
Posts: 5390
1
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and the one and only winner is Wong .....
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic