Q: run servlet application in jar

A

Andy

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
 
I

iamfractal

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

Did you trying jarring it and it didn't work? What exception did it throw?

(You must put the jar in webapps/ROOT/WEB-INF/lib)


..ed

www.EdmundKirwan.com - Home of The Fractal Class Composition
 
U

Usman Saleem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top