• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

deploying an application on Tomcat 5.5.17

 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ranchers,
First if this is not the right place for this question, please put it wherever you see apropriate.

Second, the question: I have finished developping an application usinf NetBeans IDE 5.0, Now I want to deploy it on Tomcat 5.5.17, can you please detail the steps I should follow and especially the directory structure I must have ?
(I want to move everything to Tomcat, including Servlet source files).

Thank you in advance.
Best regards,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi aymane,

We have a forum dedicated to Apache Tomcat.
I'll move this thread there for you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The simplest way is to drop your webapp, (as a war file or a properly formed directory structure) into the webapps directory in Tomcat.

Does your IDE have a feature that packages your app for deployment?

If you want to try this with a pre-packaged war file, grab any of the wars on my site, http://simple.souther.us and drop them into your tomcat/webapps directory. Tomcat will unpack them and deploy them for you.
At this point, you will have a working example of a properly packaged web app to use as a reference.
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok.
But I want, is still be able to modify my application in tomcat.
I think I used the term "deploy" in the wrong place.
Let's say I want to move from NetBeans to Tomcat.

regards,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can work directly with the files.
JSPs will automatically update themselves.

For Java classes, you'll need to recompile and move your class files to the proper directories.

Your app can be configured within Tomcat to automatically reload itself when a class file is updated. Otherwise, you can reload it via the Tomcat manager or you could just restart Tomcat.
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

move your class files to the proper directories



What are the proper directories (webapps/myApp/Web-INF/classes) ?
where should I put the .java files ? can I just compile them wherever ? and just bring the .class and put it there ?

thank you !
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The location of your .java files is irrelavant.
Tomcat does nothing with them.

Yes, the class files belong under
tomcat/{your webapp}/WEB-INF/classes/{your package}/{your class}.class

Yes, just compile them anywhere and move the class files there.
Better, use the -d switch in javac to specify where you want the compiled class files to be created.

Personally, I create a 'src' directory under WEB-INF and use the following shell script to compile single classes:

It should be pretty easy to port this to a windows .bat file for use on that OS.

For compiling the whole project, I use an ANT script.
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much. Now It's clearer.
ButThe last 2 words you said, I want to know more. What is "ANT" and What is "Ant Script" ?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic