tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <j...@kewlstuff.co.za>
Subject Re: How to run own java application within Tomcat
Date Tue, 03 Jun 2008 13:57:13 GMT

----- Original Message ----- 
From: "Slobodanka Dimitrijevic" <sdimitrijevic@dirkzwager.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, June 03, 2008 11:34 AM
Subject: RE: How to run own java application within Tomcat



Hi Johnny,
Thanks for your mail. Can you please tell me :

1. where should I stop Java executable inside Tomcat directory
structure?

2. which configuration file and what should I configure inside Tomecat
if I want to run executable java application during sturtup of Tomcat?

Thanks in advance,
Slobodanka Dimitrijevic


=============

Slobodanka just try this and you'll get the idea

I use NB but could be done with any IDE...

1) Make a Java application... normal Java application with some classes in 
it.
Compile it and (if its NB its an executable) double click on the JAR file 
(in the DIST folder)
It will run.

2) Now make a web project based on TC, in the libraries "select the 
application" that you made before.
Make a little web page that uses one of the classes in the application
Compile it.... it will give you a WAR file and inside that war file... will 
be your application.

Now you got one war file with the application in it... and the application 
can run on its own as well, which is what I think you asking?

So if a user unzips the war file... they can run the application.
So now you have 2 in one.

You'll get the idea by just seeing where you application is used in the war.
So outside its a normal application, but inside the War its being used like 
a library.

The web app has extra stuff, like web.xml and yada yada... but it doesnt 
care, to it.... the application JAR is just a lib.

Then you play from there.... decide what classes you want to put where.

Its a design thing... not some web xml that you set.

Jars are zip files... they can be applications or libs... or a mix.

You cant just drop an application into tomcat and expect it to appear in a 
web page... but you can share stuff.

The trick... make a application JAR.... the use that as a lib in TC.... NB 
will pack it for you... no thinking required ;)

---------

The POJO Application Server is a completely different animal, and you'll 
have to ask specific questions in their mailing list for that.
But that does literally allow you to drop the application into it, and the 
UI side of that application (not a web service) literally jumps out of the 
browser.
But the applications have to be designed for that.

Either way... there is some design to do.

Hope that helps.... 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message