File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes How to create package for web app in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to create package for web app in Eclipse" Watch "How to create package for web app in Eclipse" New topic
Author

How to create package for web app in Eclipse

Robin Clark
Ranch Hand

Joined: Dec 17, 2003
Posts: 81
I am creating a web application using a JSP and a java class, UtteranceInfo. The JSP creates a UtteranceInfo object and uses it. I am having trouble setting up the project in Eclipse. I created a new project making the project contents directory the root directory of my web application. Then I created a new package, utterance, that will contain the UtteranceInfo class. The compiled version of this class must reside in the WEB-INF/classes/utterance directory.
I am confused because when I create the package, the utterance folder is placed in the web application root directory and then also appears under the WEB-INF/classes directory. Initially, the compiled .class file appeared under the WEB-INF/classes directory. But then when I made changes to the UtteranceInfo.java file, I can not find the newly compiled .class file. I see the old .class file under WEB-INF/classes. When I delete the old .class file under WEB-INF/classes directory I can not see where the new .class file is getting created.
Can someone direct me to a place where I can find instructions on how to setup a project in Eclipse of this type? I have several books:
Tomcat the Definitive Guide
SCWCD Exam Study Kit
The Developer's Guide to Eclipse
I have also installed the Lomboz plugin which is handy for editting the jsp, but I don't understand how to utilize its full functionality. I am going to Microcenter tonight and will purchase any book you can recommend that would help me with this kind of setup.
Thank you for any assistance you can provide to me in setting up my work environment for this project!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Strange. Don't the Lomboz tutorials discuss creating web applications? How about this tutorial?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Robin Clark:
I am confused because when I create the package, the utterance folder is placed in the web application root directory and then also appears under the WEB-INF/classes directory.

Didn't you say that the project folder is your source-folder and that WEB-INF/classes is your class folder? Then it's of course correct that the package occurs in both - in the former for the .java files, in the latter for the .class files.
Am I missing something?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Robin Clark
Ranch Hand

Joined: Dec 17, 2003
Posts: 81
This is exactly the type of information I was looking for. Thank you ever so much!
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
You're welcome! If only it were always that simple...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to create package for web app in Eclipse