Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

package does not exist  RSS feed

 
sylvia greene
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat Server. In the webapps directory I have created following directories
webapps / shopping / WEB-INF / classes / shopping
webapps / shopping / WEB-INF / classes / servlet

I have created a bean CD.java in shopping directory and it compiles fine

CD.java


I have created a servlet ShoppingServlet.java in the servlet directory. When i try to compile it, it gives an error


package shopping does not exist

ShoppingServlet.java


Please tell me how can i resolve this.
[ July 20, 2004: Message edited by: sylvia greene ]
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess u r compiling from wrong directory...

u need to be at classes folder and compile using the following command at command prompt..



i guess this should work as if you are trying to compile from inside servlet folder then it will look for a folder named shopping inside servlet as u might have written



inside your ShoppingServlet.java.

hope this helps.. if still in doubt do revert back.

Bye and take Care
Amit
[ July 20, 2004: Message edited by: Amit KumarS ]
 
sylvia greene
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot. that worrks fine.
I have another problem though

In the webapps directory i have a shopping directory in which i have a jsp file EShop.jsp which has the following action attribute



It is looking for a servlet which is in WEB-INF/classes/servlet folder
ShoppingServlet.java



Following is the web.xml i have created for this


But when i submit i get REsource not found with the url as
http://localhost:8080/ShoppingServlet
 
Amit KumarS
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

good that last oje worked fine...

now the prob is that you r putting extra .. in your action

write like this..



this will work fine..

if any more doubts .. do revert backk

bye
Amit
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!