Apache Tomcat 4.0 Final Released
A reader writes "The latest version of the Apache Java Servlet engine has been released. 'The 4.0 release implements the Servlet 2.3 and JSP 1.2 specifications.' Read more at The Apache Group's Jakarta site."
← Back to Stories (view on slashdot.org)
Tomcat is getting pretty good. Version 4 makes it very easy to deploy new webapps: it includes a web admin interface, and new apps can be deployed without restarting it. As a standalone webserver it is also fairly competent, at least for specialised applications with smaller user numbers.
.NET. Actually I think it is ahead. In the future we will get the XML Binding API, that makes it possible to compile XML Schemas to java "xml manipulator" classes that can be used to manipulate XML instances of these schemas. XML parsing and manipulation will then be childs play. Define your schema, compile it and you have code that is specialised to work with these documents!
Apache does some great things with Java. I have worked both with Tomcat (servlet container), Xerces (XML parser) and Xalan (XSLT engine). Thanks to the good work to come out from Apache, Java has become a very strong competitor to MS
With a strong XML foundation in place, Java's future is looking really good.
I'm not completely up to speed on what Java Web development enhancements this brings to the table. However, I can honestly say that in my dealings with ßeta versions of Tomcat 4.0, the configuration files for Tomcat 4.0 are 1000x times easier and more sensible! The configuration files for Tomcat 3.x look like they were designed by a monkey on crack (or a Sendmail developer). Tomcat 4.0 config files are finally well thought out and usable. Can't wait to get my systems upgraded! :)
Tomcat 4 was waiting for the new servlet standrd from Sun to become from draft to final.
:)
THAT WAS TODAY. Less than six hours later (I don't know the exact amount of time) Tomcat was announcing the official release of Tomcat 4. That is going fast!
That the 2.3 Servlet specification and 1.2 JSP Specification have been released as final.
Marcelo Vanzin
The 3.x and 4.x trees are completely different codebases... My understanding is that the 3.x tree will continue to get a certain amount of maintenance and development while the 4.x tree gets shaken out.
4.x has been in beta for a while, they've mainly been waiting for Sun to finalize the specs.
--Dg
Make sure you have a JDK installed, like Sun's Windows version.
Unzip to a directory - taking the defaults sets you up in c:\jakarta-tomcat-4.0.
Go to the control pannel, click system, click advanced, click Environment Variables. Click new button on system variables and create a JAVA_HOME with a path to where you extracted your JDK. (My box has javac located in c:\jdk\bin, so my JAVA_HOME is c:\jdk). Create a TOMCAT_HOME as above pointing to c:\jakarta-tomcat-4.0.
Open up a command prompt, cd to c:\jakarta-tomcat-4.0\bin and run startup.bat.
Open a browser and type in http://localhost:8080, you should see it...
Happy hacking in the example code!
+++ UGUCAUCGUAUUUCU
I wasted a week of my life trying to get tomcat 3.2.x up and going on a solaris machine. The documentation was the worst that I had *ever* run across, with "how-tos" sporadically jumping back and forth between version 3.1 and 3.3, with not one single "clear, concise, consistent" document available for 3.2 (the previously current stable version). Even step involved downloading another package from the jakarta project, trying to figure out *it's* documentation, installing it, testing, and then finally getting back to tomcat just to discover (generally buried in some obscure comment four pages into a mostly-irrelevant faq) that you need to go get something else.
.jsp support in all my user's home directories, the same way we do with cgi's (this is intranet, and we have a lot of people running things out of their ~username). Can't be done. Absa-no-freaking way. Either you configure each directory individually, basically "giving" the /public_html/ dir to tomcat and bypassing apache completely, or you make everybody create a new directory and then configure them *individually*. If someone has a work around for this, I would *love* to hear it. Note the main problem is that tomcat doesn't understand the ~ syntax, so the url passed by apache when a .jsp page is requested is "foo.com/~user/baz.jsp", and then tomcat complains that ~user/baz.jsp doesn't exist. This is the #1 reason jsp/servlets aren't used more where I work.
Frankly, it wasn't until I got it going on a debian/x86 machine (apt-get install tomcat) that I was able to trace my way back and install it on solaris. Not that apache itself was much better, trying to get apxs working.
Then, after it was going, I tried to enable
So, I am *eager* to try out this release, and I truly hope that my complaints are now foundless. I would love nothing better than to be proven wrong, that the documentation has been completely overhauled, that it now understands the common ~username, that it works with any jdk besides blackdown's (on linux), and that it basically doesn't suck. But I'm not holding my breath.
also ant 1.4 was released recently (couple weeks ago). ant is a great build tool, i don't want to get into its features here (java and xml based build, replaces makefiles for my java builds, integrates with some IDEs and build verification/unit test tools (JUnit)). the reason i post here is because ant started out as a little tool with which tomcat developers build tomcat, and grew into its own tool. ant home page on jakarta.
The REAL sam_at_caveman_dot_org is user ID 13833.
From what I've read on the Tomcat-user list, Tomcat does not do EJB and JBoss is the usual recommendation.
LEXX
"Gold still represents the ultimate form of payment in the world." - Alan Greenspan, 1999
The 3.x and 4.x trees are completely different codebases... My understanding is that the 3.x tree will continue to get a certain amount of maintenance
and development while the 4.x tree gets shaken out.
I know. Actually, 3.x was based on the Sun Java Server, whose source code was donated.
The irony is that it's taking longer for the 3.x line to get fixed properly than it is for the developers to have worked from scratch on a rewrite of the whole thing. There are quite a few things wrong with 3.2 which I won't get into (yes, we DO use it in production). I know that these things have been addressed in 4.0, while 3.3 is still working on it.
You can accomplish anything you set your mind to. The impossible just takes a little longer.
JRun is commercial, from Allaire/Macromedia. You can download it for free, though, at Allaire. They have several different versions to download. Professional and Enterprise are the full version of the product, but with a 30-day time limit. You'll need a license key. The difference between them is that Enterprise supports EJB, JTA, and JMS, which are Java API's for building complex applications on the server. Tomcat is like Professional in that it supports JSP and servlets, which are similar to PHP and CGI Perl for all you non-java slashdotters.
I actually don't have performance numbers for Tomcat 4.0 and JRun 3.1, since Catalina just got GA'd. If you can live without the support for JRun from Macromedia, and you want to save about a thousand bucks a server, give Tomcat a chance. You're probably not using EJB (Enterprise JavaBeans) anyway, since they were only supported in JRun 3.x.
Tips and Tricks for Mozilla
For $10/mo, I get PHP/MySQL, unlimited bandwith, unlimited hard drive space, unlimited POPs, etc.
Plus there's cool stuff like PHPNuke, just getting a simple contact me mail-to form to work in PHP is a piece of cake.
Oh and a small correction - JavaScript has nothing to do with JSP or Java programming at all.
Tips and Tricks for Mozilla
Bleh!
Tomcat is a servlet container, not an EJB container. As such, it can only run servlets, jsp's (which really are just special cases of servlets), and javabeans. You need an EJB container to run EJB's. The most popular open-source EJB container is JBoss (it also integrates very well with Tomcat).
Your are correct in saying that you never instantiate an EJB directly, you ask the container for a reference to an EJB and the container can instantiate a new EJB for you or reuse an old one or pull one out of a pre-existing pool.
BTW, you may want to look into using JAAS (Java Authentication and Authorization Services) which was released today as a component of J2EE 1.3 for some of your security needs.
Actually, I find the 4.0 documentation to be much better than previous versions. It also has very good quality in general when you compare it to 99% of other open source projects out there, not to mention some commercial products. You should check out their how-to's, you'll see what I'm talking about.
"The deluded are always filled with absolutes. The rest of us have to live with ambiguity." - Aristoi, Walter Jon Willia
And if you do need EJB support, give JBoss a look. It's open source and intergrates well with Tomcat to provide the EJB side of things.
"I'll take the red pill. No! Blue! AAAaaaahhhhhhhhh"
- Monty Python meets the Matrix
And if you wish to continue to use JSPs, check out Jakarta Struts. Struts provides a very nice way to continue using JSPs whilst still getting complete separation of presentation/controller/business logic. Highly recommended.
Gollo.
but I'm curious as to why PHP is so popular when JSP provides a much more robust solution
PHP is not a one-fits-all type of solution. It does not provide the same infrastructure that Java solutions do, and it is not a pure OO language. However, there are some good reasons to use it, depending on your situation:
[1] Easier to learn than Java
[2] Simpler to setup than many Java solutions
[3] A great selection of extremely useful, easily accessible, built-in functions
[4] Wide selection of books that don't assume you're already an experienced engineer
The creators of PHP went to great lengths to remove as many of the needless annoyances of web development as possible. They provide a lot of ready made solutions to small, but annoying common problems. The language has bent itself to developer needs, rather than the other way around.
PHP's creators realize that people just want the damn thing work, which is even evident in the installation instructions and documentation. This philopsophy, while starlingly rare in the open source world, is probably at the core of why PHP has such a devoted following.
The strip_tags function is probably a good example of this. You give it a text string and it will remove all HTML tags contained therein. That's it. You can optionally tell it specific tags that you would like to leave in. This function is built into the language. PHP users love this. Many other languages would expect you to write a custom regex routine or go find some code somewhere to take care of it. Or you can start playing the module dependency game. These isn't the kind of stuff I want to do at 2am.
- Scott
Scott Stevenson
Tree House Ideas
That's *one* licence it grants. The JRE *also* grants you the licence to use it in a normal way. This really isn't a problem - people have been distributing the JRE with their apps for ages.
Jon