Re: Servlet container/server for Linux
Ross wrote:
I've used tomcat extensively, but didn't want to use it this time
because I'm temporarily on an old machine that it is not worth
upgrading, but while I'm here for a few days, I don't want to put a
lot of effort into the machine.
So everyone says "tomcat". From past experience, I have a bad feeling
about this, but I download and install tomcat. I move it to a
directory with a simple path. I add the tomcat "bin" directory to my
path, and change the permissions of the .sh files in the /path/to/
tomcat/bin directory.
I then make sure I've got both JAVA_HOME and JRE_HOME environment
variables set properly.
I then run startup.sh. Tomcat starts, and reports everything fine
(directories).
What happens when I go to http://localhost:8080?
Nothing, it just hangs.
Is that the port for which Tomcat is configured? Does your /etc/hosts/
resolve "localhost"? What happens when you try to browse to
http://127.0.0.1:<port>/ instead?
OK, so I've got a problem. I don't know what it is, but I've got to go
through the standard dance of trying to work out what it is and how to
fix it.
That's why they pay you the big bucks.
I don't want to be working on a tomcat or other fully featured servlet
engine that is taking time to configure. I want to have something like
this:
$ java -jar simpleServletEngine.jar /path/to/servlet/classes
Where I can then run:
$ konqueror http://localhost:8080/MyServletName
and see it run.
JARs aren't designed to hold servlets and associated resources; WARs are.
You get what you ask for from Tomcat. You can use the deploytool much like
you ask of "java -jar", then use konqueror just as you describe.
I know enough about servlets to know that this interface is entirely
possible, and that it would be useful to people learning servlet
programming independent of server administration.
And it exists! See my description previous paragraph.
I've downloaded Jetty. It runs fine, java -jar start.jar, and you can
immediately see all the demonstration servlets. Good I think. So, how
do I add my own Servlet class to the engine, Can't find any class
files for the demo servlets, so how do I add mine. I then start
trawling through the documentation to find out what you'd think is the
most simple straightforward thing that 99% of people would want to do.
And basically, no doing. What do I get when I click on a link titled
"How to test a servlet?" You'd think it would tell you how to test a
servlet. No, it goes straight into testing servlets with an embedded
server. http://docs.codehaus.org/display/JETTY/ServletTester Can't I
just put my bl**dy servlets in a directory and run them?
No. You need a servlet container. Too bad. You want to run a servlet, you
need something that knows how to run servlets. *Any* such product would
require you to set a port for the connection.
Fundamentally, I don't want to be wasting my time doing all this, I
want to write some servlets and do some simple testing of them. But
I'm searching around for a simple, straightforward, easy to use tool.
You should be more familiar with Tomcat then. Don't blame the tool because
you don't know it well enough.
--
Lew