I am asking the possibility to run the whole servlet application
compressed into jar for tomcat5.
The servlet class in application runs perfectly with tomcat5. But I
would like to try to jar the application and run it with tomcat5?
Possible? How?
Thanks
You can always run your web application using .war (Web Archive) file.
Typically you need to deploy it (drop it) in a specific folder
(depending upon your servlet engine). For tomcat, the directory would
be "webapps".
To create the war file, for example, you may use command
jar -cvf yourApp.war *
to create your "one file" web application.
The contents of a simple war file may be as follows:
yourApp.war
file_1.jsp (JSP File)
file_n.jsp (JSP File)
WEB-INF (Folder)
web.xml (XML file)
classes (Folder)
yourServlet_1.class (Java class file)
yourServlet_n.class (Java class file)
lib (Folder)
yourLib_1.jar (Jar File)
yourLib_n.jar (Jar File)
META-INF (Folder)
MENIFEST.MF (Manifest File)
Your servlets will go in the classes folder (you may have to create
additional directories to represent your application package
structure)
The required jars for your application/servlets/JSP files will go to
lib folder
The web.xml file is the most important file. It describes various
information regarding your servlets etc.
All your jsp file will remain in the root of your .war file.
I hope this gives you a good ahead start.
Best Regards,
Usman Saleem
Associate Consultant
Fusion Technologies
http://www.fusiontech.com