This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm just starting the servlet assignments. I'm using Tomcat, and everything works fine on my end. However, because Tomcat doesn't have a default web application like Orion, I'm concerned that the nitpickers won't be able to run my assignments. I've tried to find Orion, but have been unsuccessful: www.orionserver.com sends me to a Thai gambling site. From other people's stack traces I thought of trying www.evermind.com. This is an enterprise application server site, but everything was in Spanish and there was no download for orion.jar.
Anyhow, I would prefer to stay with Tomcat, as I've FINALLY got it integrated with Eclipse, which is my development platform. Tomcat expects webapp directories underneath its /webapps directory. I have an Eclipse project called CattleDriveServlets, so all of my servlet assignments will be deployed to this webapp directory. This means, for example, that for assignment 2, the action attribute in the reverse.html form must be set to action='/CattleDriveServlets/servlet/ReverseServlet'. I can change this before posting my assignment (i.e. remove "/CattleDriveServlets", and it should work on your side. Except that I am also using a different package structure. So. my questions are:
- Is it OK to use Tomcat?
- If not, where can I find the Orion download?
- Do I need to move all my servlets to com.javaranch.drive?
- Is there anything else I need to do (besides modifying the URLs) to be compatible with your test environment.
However, if you want to use Tomcat, I'd be fine with that. If you do though, I'd like you to carefully document what you need to do to install and configure Tomcat in order to run the assignments. Ideally, we could add this to the Cattle Drive and give future "nitpickees" a choice of platforms. Think of yourself as a pioneer!
Ulf Dittmer wrote:
That's something entirely different that happens to have a similar name. Orion the servlet container is truly dead (and has been obsolete for many years).
Apologies. I didn't look into that link carefully enough. I know Oracle 10g used Orion for its web apps (because I'm using it on a project right now, and, yes, very unhappy about that), so it made sense that Oracle would be hosting it for downloads. Well, I have the download for OS X from when I took over this part of the Cattle Drive, and we could probably get a Windows version from one of the other students. It was available until relatively recently. I'm definitely fine with students going with Tomcat though. By the way, I'm also fine with students using a newer version of Java than the 1.4 suggested in the Cattle Drive assignments.
Thanks for the answers. I'd be happy to document how to use Tomcat for the assignments. I installed Tomcat awhile back, but I think I can reconstruct what I did, including how to get it to work as a server in Eclipse (which allows for more seamless debugging). It will be particular to my environment, though, which is:
- Windows 7
- Tomcat 7.0.25
- jdk 1.6.0_25 (only thing important here is that the most recent version of Tomcat requires a 1.6.x)
- Eclipse Indigo
I know that - at least for the the Java and OOP assignments - use of an IDE is discouraged. So, I will try to explain how to use Tomcat without Eclipse, too. I'll assume a package structure of com.javaranch.drive. As far as the subdirectory under /webapps goes: I do think that is required, but I'm not entirely sure. It was, in any case, a "given" for me, since I created a dynamic web project (CattleDriveServlets) in Eclipse to hold my Servlet assignments. I'm also not sure if it is appropriate to have just one project for all the assignments. Looking ahead, I see that we are going to be building .war files, and it might be better not to have all the servlets deployed in a single .war/web.xml. So, I guess the document will have to be a work in progress.
As to JBoss: I installed it a couple of days ago (in Eclipse). Worked right away for their examples, but there were problems with my servlets' URLs (not surprisingly). Anyhow, I decided not to get ahead of myself and keep it simple with Tomcat. But, I will fiddle with it from time to time and will document that so that when I get to the EJB assignments I can tell people how to install JBoss, too.
BTW, I was trying to figure out whether to use JBoss or Glassfish. Do you all have any preferences about that? I chose JBoss because I already had the JBoss tools installed in Eclipse - so it seemed to have a good integration.
For the assignments, Tomcat is plenty. You won't need JBoss at all, but I certainly encourage you to try it out on your own. I generally don't like running servers inside the IDE. It's fine though, as long as you know how to run an external server, and how to build and deploy your application to it. IDEs tend to hide those details to the point that people no longer know how to do anything manually.
There's a lot online discussion of JBoss vs. Glassfish, and each has its supporters. I believe that JBoss has a higher market share and more active developer community, but I can't prove it. I know I've used JBoss in several projects myself, but no customer of mine has ever asked for Glassfish.