You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Danilo Cubrovic <cu...@gmail.com> on 2007/01/12 16:17:34 UTC

Using tomcat as client application

Hi all.


I seen this thing I need exists for php years ago but not sure is anyone
make this with tomcat.

I have web application (java jsf+xml) that works fine on tomcat.
I also have some significant numebr of users that use client version of this
program (java applet+xml)
In most of the part this is sthe same code except for the presentation
layer.
Well , ass you all know,  this is pain in the a.. when you have to work
parallel on two version plus web version is much better in many ways.

What I'm intersting is next thing.
Can I pack somehow web application and tomcat and install it on user client
pc.
(I will create setup.exe and send iton cd like client they use now)
So when client click on shortcut on his/her pc (all of them are windows
operated) he gets this application started via tomcat.
Well there is trick. In order to work with all firewalls dont want to start
tomcat as classic webserver but to use it as background application to
handle requests and generate pages ...
Is there some tomcat solution that can work like this?




Danilo Cubrovic

Re: Using tomcat as client application

Posted by Danilo Cubrovic <cu...@gmail.com>.
After some trouble starting embedded tomcat I manage to use it for what 
I want.
Except one thing.
When I start it like application it's ok but when I start it from within 
my signed applet it doesnt work at all.
It looks like some ClassLoader's issues.
I also have similar ClassLoader issues when I start that same 
application within Eclipse.
Is there any way to manage it to work in that case.

Leon Rosenberg wrote:
> The probably easiest way for you is to build a mini
> container-application which contains embedded tomcat with your app.
>
> At least I would give it a try.
>
> regards
> Leon
>
> On 1/12/07, Danilo Cubrovic <cu...@gmail.com> wrote:
>> Hi all.
>>
>>
>> I seen this thing I need exists for php years ago but not sure is anyone
>> make this with tomcat.
>>
>> I have web application (java jsf+xml) that works fine on tomcat.
>> I also have some significant numebr of users that use client version 
>> of this
>> program (java applet+xml)
>> In most of the part this is sthe same code except for the presentation
>> layer.
>> Well , ass you all know,  this is pain in the a.. when you have to work
>> parallel on two version plus web version is much better in many ways.
>>
>> What I'm intersting is next thing.
>> Can I pack somehow web application and tomcat and install it on user 
>> client
>> pc.
>> (I will create setup.exe and send iton cd like client they use now)
>> So when client click on shortcut on his/her pc (all of them are windows
>> operated) he gets this application started via tomcat.
>> Well there is trick. In order to work with all firewalls dont want to 
>> start
>> tomcat as classic webserver but to use it as background application to
>> handle requests and generate pages ...
>> Is there some tomcat solution that can work like this?
>>
>>
>>
>>
>> Danilo Cubrovic
>>
>>
>
> ---------------------------------------------------------------------
> 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
>
>


---------------------------------------------------------------------
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


Re: Using tomcat as client application

Posted by Leon Rosenberg <ro...@googlemail.com>.
The probably easiest way for you is to build a mini
container-application which contains embedded tomcat with your app.

At least I would give it a try.

regards
Leon

On 1/12/07, Danilo Cubrovic <cu...@gmail.com> wrote:
> Hi all.
>
>
> I seen this thing I need exists for php years ago but not sure is anyone
> make this with tomcat.
>
> I have web application (java jsf+xml) that works fine on tomcat.
> I also have some significant numebr of users that use client version of this
> program (java applet+xml)
> In most of the part this is sthe same code except for the presentation
> layer.
> Well , ass you all know,  this is pain in the a.. when you have to work
> parallel on two version plus web version is much better in many ways.
>
> What I'm intersting is next thing.
> Can I pack somehow web application and tomcat and install it on user client
> pc.
> (I will create setup.exe and send iton cd like client they use now)
> So when client click on shortcut on his/her pc (all of them are windows
> operated) he gets this application started via tomcat.
> Well there is trick. In order to work with all firewalls dont want to start
> tomcat as classic webserver but to use it as background application to
> handle requests and generate pages ...
> Is there some tomcat solution that can work like this?
>
>
>
>
> Danilo Cubrovic
>
>

---------------------------------------------------------------------
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


Re: Using tomcat as client application

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Danilo Cubrovic wrote:
> Well Java Web Start is opposite of what I need.
> It allows you to deploy yours desktop application via web to users.
> I want to make possible use of my web application (tomcat+java jsf) to 
> some
> of my users that cant/want use internet.
Oh, I see. So you will need an 'offline' tomcat bundle, I'd say. To run 
it on localhost and don't care about firewalls, etc. I wrote a set of 
scripts to accomplish that goal. Probably you'll need to tweak them to 
fit to your tomcat's version.

http://ceti.pl/~miki/komputery/tomcat_demo/

You could also try to run embeded tomcat instance - in such case you 
cold create nice starter app to choose i.e. the port your tomcat will 
listen on.

> Plus I have limitations of corporate firewalls so I want to use it in 
> some
> non-server way, and limitations of possible hardware limitations 
> (there are
> number of users with older computers and little ram)
Running tomcat+jsf application implies more ram...


-- 
Mikolaj Rydzewski <mi...@ceti.pl>


Re: Using tomcat as client application

Posted by Danilo Cubrovic <cu...@gmail.com>.
Well Java Web Start is opposite of what I need.
It allows you to deploy yours desktop application via web to users.
I want to make possible use of my web application (tomcat+java jsf) to some
of my users that cant/want use internet.
Plus I have limitations of corporate firewalls so I want to use it in some
non-server way, and limitations of possible hardware limitations (there are
number of users with older computers and little ram)

On 1/12/07, Mikolaj Rydzewski <mi...@ceti.pl> wrote:
>
> Danilo Cubrovic wrote:
> > I have web application (java jsf+xml) that works fine on tomcat.
> > I also have some significant numebr of users that use client version
> > of this
> > program (java applet+xml)
> > In most of the part this is sthe same code except for the presentation
> > layer.
> > Well , ass you all know,  this is pain in the a.. when you have to work
> > parallel on two version plus web version is much better in many ways.
> >
> > What I'm intersting is next thing.
> > Can I pack somehow web application and tomcat and install it on user
> > client
> > pc.
> > (I will create setup.exe and send iton cd like client they use now)
> > So when client click on shortcut on his/her pc (all of them are windows
> > operated) he gets this application started via tomcat.
> > Well there is trick. In order to work with all firewalls dont want to
> > start
> > tomcat as classic webserver but to use it as background application to
> > handle requests and generate pages ...
> > Is there some tomcat solution that can work like this?
> I suggest you to try Java Web Start. In short it allows you to run Java
> applications (swing, desktop applications) directly from the web. It
> handles upgrading to news versions, firewalls (just http / https),
> caching jars on client machine, etc.
>
> --
> Mikolaj Rydzewski <mi...@ceti.pl>
>
>
>
>


-- 

Danilo Cubrovic

Re: Using tomcat as client application

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Danilo Cubrovic wrote:
> I have web application (java jsf+xml) that works fine on tomcat.
> I also have some significant numebr of users that use client version 
> of this
> program (java applet+xml)
> In most of the part this is sthe same code except for the presentation
> layer.
> Well , ass you all know,  this is pain in the a.. when you have to work
> parallel on two version plus web version is much better in many ways.
>
> What I'm intersting is next thing.
> Can I pack somehow web application and tomcat and install it on user 
> client
> pc.
> (I will create setup.exe and send iton cd like client they use now)
> So when client click on shortcut on his/her pc (all of them are windows
> operated) he gets this application started via tomcat.
> Well there is trick. In order to work with all firewalls dont want to 
> start
> tomcat as classic webserver but to use it as background application to
> handle requests and generate pages ...
> Is there some tomcat solution that can work like this?
I suggest you to try Java Web Start. In short it allows you to run Java 
applications (swing, desktop applications) directly from the web. It 
handles upgrading to news versions, firewalls (just http / https), 
caching jars on client machine, etc.

-- 
Mikolaj Rydzewski <mi...@ceti.pl>


Re: Using tomcat as client application

Posted by Danilo Cubrovic <cu...@gmail.com>.
Well I already use your soultion.

I have same jar file I use on web server and on that client application.

Client application is in frames. Left frame is java applet that 
represents search engine. In right frame I show search results and a lot 
of html data that user search for (some legal stuff)
So this is combination of java applet +javascript neded for interframe 
communication + ...
It seems to me a little dirty so I like to clean that little bit.
I have total separation of applicaion logic and presentation. (3 layers)
Well I start to transfer all of that into full page applet application 
but this is tricky because of poor supoort for html +css data and all of 
our data is in that format
plus Presentation is often change to reflect some new stuff and it is 
annoying to change and test on two different places.

Embeeded tomcat seems intersting solution.
I will make an applet that load tomcat and then redirect to start page 
and let tomcat hadle from that point.

But Im not sure how that will work?!
And more important in that way tomcat have to listen on some port and 
that can be huge problem for me with all the coroprate firewalls and 
unprivileged users.
If i can use tomcat embedded to parse url and generate html without 
acting as server that would be ideal, but can I achieve something like 
that, or as close as I can.

Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Danilo,
>
> Danilo Cubrovic wrote:
>   
>> I have web application (java jsf+xml) that works fine on tomcat.
>>
>> Can I pack somehow web application and tomcat and install it on user client
>> pc.
>>     
>
> This is possible, but probably non-ideal. If your Java applet is pretty
> good-looking, consider deploying it as a client-side app (that is,
> unwrap the applet into a full-fledged application).
>
> You could take your existing web application and split it up into
> components: back-end versus presentation. That shouldn't be all that
> hard assuming that you already have a pretty good separation between
> your business logic and data access layers versus your presentation layer.
>
> Then, for a web deployment, you simply use your business logic + data
> access layers as the foundation (JAR files?) for your web app. The same
> can be done for the local deployment.
>
> Perhaps this is not the solution you're looking for, but it's definitely
> one option.
>
> Good luck,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFp8Qd9CaO5/Lv0PARAu78AKC59rC3TD4v4ISJZKzEq9h4O36I7wCeO7w1
> bMWvdUh5DiH6BFRLWsvZHyI=
> =Q/Lf
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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
>
>
>   


---------------------------------------------------------------------
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


Re: Using tomcat as client application

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Danilo,

Danilo Cubrovic wrote:
> I have web application (java jsf+xml) that works fine on tomcat.
>
> Can I pack somehow web application and tomcat and install it on user client
> pc.

This is possible, but probably non-ideal. If your Java applet is pretty
good-looking, consider deploying it as a client-side app (that is,
unwrap the applet into a full-fledged application).

You could take your existing web application and split it up into
components: back-end versus presentation. That shouldn't be all that
hard assuming that you already have a pretty good separation between
your business logic and data access layers versus your presentation layer.

Then, for a web deployment, you simply use your business logic + data
access layers as the foundation (JAR files?) for your web app. The same
can be done for the local deployment.

Perhaps this is not the solution you're looking for, but it's definitely
one option.

Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFp8Qd9CaO5/Lv0PARAu78AKC59rC3TD4v4ISJZKzEq9h4O36I7wCeO7w1
bMWvdUh5DiH6BFRLWsvZHyI=
=Q/Lf
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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