• 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

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 .....
 
Do you pee on your compost? Does this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic