Integrating servlet container into my stand alone App  
Author Message
gregfrommer





PostPosted: 2004-9-26 2:42:00 Top

java-programmer, Integrating servlet container into my stand alone App Hello Everyone,

I had this idea for an application I would like to write. I want
to write it as a java application, but be able to output
program-generated .html into an Internet Explorer window. Sending the
generated html to the IE window is easy... just using the Runtime
class. But I want the Internet Explorer window to be able to make http
calls back to my application for form submissions. I didn't want to
have to force my users to install Tomcat just so the internet explorer
could pass back information to the servlet in my .Jar file.

How hard is it to add a servlet container and respond to http post's
from the localhost internet explorer window? This is all from my .jar
file and not from a web application running under tomcat remember. The
only http requests coming into my application will be from that one
internet explorer window... so its really acting like a
single-user-local-machine Tomcat server. But I dont want the burden of
forcing Tomcat on people.

I suppose you'll say pick a standard application or a jsp/servlet
solution, but not both.... but I think there is a lot of flexability
to this method, being able to generate GUI screens on the fly in the
IE window is really exciting.

Thanks,

Greg
 
Silvio Bierman





PostPosted: 2004-9-26 8:20:00 Top

java-programmer >> Integrating servlet container into my stand alone App
"DiscoStu" <email***@***.com> wrote in message
news:email***@***.com...
> Hello Everyone,
>
> I had this idea for an application I would like to write. I want
> to write it as a java application, but be able to output
> program-generated .html into an Internet Explorer window. Sending the
> generated html to the IE window is easy... just using the Runtime
> class. But I want the Internet Explorer window to be able to make http
> calls back to my application for form submissions. I didn't want to
> have to force my users to install Tomcat just so the internet explorer
> could pass back information to the servlet in my .Jar file.
>
> How hard is it to add a servlet container and respond to http post's
> from the localhost internet explorer window? This is all from my .jar
> file and not from a web application running under tomcat remember. The
> only http requests coming into my application will be from that one
> internet explorer window... so its really acting like a
> single-user-local-machine Tomcat server. But I dont want the burden of
> forcing Tomcat on people.
>
> I suppose you'll say pick a standard application or a jsp/servlet
> solution, but not both.... but I think there is a lot of flexability
> to this method, being able to generate GUI screens on the fly in the
> IE window is really exciting.
>
> Thanks,
>
> Greg

Greg,

My company supplies a software system that is basically based on standard
servlets but since most of our potential customers do not own or want to own
a J2EE server environment we normally distribute our servlets packages with
a servlet container that can be simply embedded in a Java app (of no more
then a few lines). In short, people only install a JRE, unpack our ZIP and
fire up the app. For windows environments we cooked up a service wrapper EXE
and that is it.

Actually, our system consists of a central server that has no user
interfaces but handles XML requests through HTTP (servlets handle the
requests through the servlet container) which come from multiple application
servers (servlets that generate HTML as the UI and connect to the central
server via HTTP requests). Both tiers are servlet based and use the same
setup.

The embeddable server is Jetty (www.mortbay.org) which is one of the best
(free) servlet containers available and very simple to embed (including
sample code and great free support through the mailing lists).



 
gregfrommer





PostPosted: 2004-9-27 11:41:00 Top

java-programmer >> Integrating servlet container into my stand alone App > The embeddable server is Jetty (www.mortbay.org) which is one of the best
> (free) servlet containers available and very simple to embed (including
> sample code and great free support through the mailing lists).


That sounds exactly like what I need. Thanks for pointing it out.