File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes package does not exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "package does not exist" Watch "package does not exist" New topic
Author

package does not exist

sylvia greene
Ranch Hand

Joined: Jun 23, 2004
Posts: 40
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

Joined: Oct 10, 2003
Posts: 100
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 ]

****************************<br />In 24 hrs Earth rotates once on its Axis.
sylvia greene
Ranch Hand

Joined: Jun 23, 2004
Posts: 40
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

Joined: Oct 10, 2003
Posts: 100
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
 
 
subject: package does not exist