• Post Reply Bookmark Topic Watch Topic
  • New Topic

why we put all classes that we need to access from jsp in directories under classes?  RSS feed

 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
why do we need to put always classes that we need to access from within jsp in directories under classes directories with tomcat?
can we put them in classes directory?and how we import them then?
here is me code that i use to access classe in coreservlet directory and it works,but when i put my class(Toc.class )in classess directory i do not know how to import it from within my jsp.
here is the code:
//========================================
<%@ page import="coreservlets.Toc " %>
<%=Toc.getData()%>
//============================
package coreservlets;
public class Toc
{
public static String getData()
{

return "something from Toc java class ";
}

}
//==============================
thanks for your time.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!