• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Classpath ??? Urgent ! :(

 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
im facing a problem with setting the classpath on Tomcat 4.0.. hmm lemme explain it.
I kept a servlet inside the package
test.common
the name of the servlet is GenerateMenu.java
ie the servlet path is
..web-inf/classes/test/common/GenerateMenu.java.
I want to use a JavaBean to store some values..
i kept the Bean (MenuBean.java) inside classes directory .ie the path of bean is
..web-inf/classes/MenuBean.java
i set the classpath to the classes directory..
I was able to call files from another packages like test.dbase.DBConnectionManager from
GenerateMenu, but its showing compilation error for the MenuBean which i kept inside the classes directory.
the complation o/p is

GenerateMenu.java:30: cannot resolve symbol
symbol : class MenuBean
location: class test.common.GenerateMenu
MenuBean menu; ^
GenerateMenu.java:66: cannot resolve symbol
symbol : class MenuBean
location: class test.common.GenerateMenu
menu = new MenuBean();
^
2 errors

I have to access this bean from JSP, so i don't want to keep it inside any packages !!! is it a right practise ??
can any1 tell me how to solve this ???
thanx
Raj
 
Rajni Kumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u place the servlet (GenerateMenu.java) in classes folder and compile.
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi cuttie,
thanx for ur reply..anyway i solved it..i had to add

import MenuBean;

inside the GenarateMenu.java file...
silly doubt naa !!!
Thnx
Raj..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic