aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Creating own servlet application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Creating own servlet application" Watch "Creating own servlet application" New topic
Author

Creating own servlet application

Padmaja Balaji
Ranch Hand

Joined: Jun 13, 2001
Posts: 122
I managed to install Tomcat 4.0 and could run all the servlet / jsp examples.
Can u please explain me how to create a folder for my application so that on compilation, the .class files should go to WEB-INF/classes folder ?
(I tried to run "build" under docs/appdev/sample directory but to no effect).
Padmaja Balaji
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Padmaja in command prompt it was --- javac -d D:\jdk1.3\myDir sample.java when we were coding in JDK1.3. I don't know if there is some thing else....
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Padmaja Balaji
Ranch Hand

Joined: Jun 13, 2001
Posts: 122
Dear Ashik,
Right now, I am putting all the servlets in 'webapps/examples/WEB-INF/classes' dir to compile and run on the browser ( beginner's struggle). Now, I want to create a "myapp" folder wherein the WEB-INF/classes (where .class files go) should be built when I run "build.bat". I am glaring at my computer to set things right for the past two days but of no use .
Did u manage to do this? If yes, please shoot your reply immediately. I am waiting...........
Padmaja
Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

Padmaja, i created a folder named ashik4u in my webapps\root directory and copied all my html files here from where i access servlets at webapps\examples\web-inf\classes directory.
I overlooked ur reply last time so too late now(only i & 1/2 months )....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
Padmaja Balaji
Ranch Hand

Joined: Jun 13, 2001
Posts: 122
Thanks for your reply ATLAST. Just back from my vacation, hence the delay in reply. Before going for my vacation, the only thing that I did was to catch hold of a person who in turn contacted his friend in Singapore to help me out. I am reproducing the steps provided by this gentleman (many thanks to him).
Steps :
1) create a new application called myapp under tomcat.
open the server.xml file in the config directory
under the tomcat directory where you installed tomcat.
you will see sample <context> tags used for specifying
application. one of them is the examples application
which maps to the examples directory in the webapps
directory.
copy and paste the tag and specify your own values.
ex
<Context
path=/myapp
docBase="webapps/myapp"
CrossContext="true"
debug="0"
relodable="true"
>
</Context>
2) create myapp directory under webapps and create
web-inf/classes directory under it.
All your jsp, html,images will placed under myapp
directory in the root of subdirectories as you wish
Java Classes and servlet will go under web-inf/classes
directory.
3)test http://localhost:8080/myapp
This may be of help to u.
It took just 15 minutes to sincerely follow his steps but yet to open the servlet books.
Anyway, I am cramming with ASP book to get an opening in the development side. (I may also appear for the second interview next week on ASP, if my assumption is right). Extremely tiring to start another subject, yet I do have no choice. Let me try atleast.
All the very best for your SCWCD exam.
Padmaja
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating own servlet application
 
Similar Threads
JSP generated servlet codes
Need to run one servlet application from subfolder of another servlet application.
where does servlet run in tomcat 6 Server.?
Servlet not found exception
Saving image on server.