This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
After a month off doing non-java things, I'm trying to get back to the javaranch assignments. My next one is Servlets-3b which is to do an Ant file that will set up and deploy a war file, and I have some questions:
1: A month ago I typed in the build.xml file on the web page. Last night I compared the current build.xml file with the one I typed in a month ago. They are different in that they use different directory structures for the java, jsp, web.xml, etc. files. I have yet a different directory structure for my servlet stuff. What are you looking for in the Ant file? My preference is to use my current directory structure.
2: The assignment instructions say to modify the Orion default application so that default application is the class assignment. I'm working with Tomcat and I can temporarily modify the default application to be the class assignment but I'm wondering if it's okay to do the assignment so that the war file sets up another servlet application that can be accessed through the servlet container. Also, I'm pretty sure I can figure out how to do this with Tomcat. I'm guessing, but I'm not sure, that a war file set up for Tomcat should work with Orion? Do you know?
Arggh. You got me! I just updated the servlets assignment page a day or two ago. The current one is the preferred directory structure. In fact, ..., well, I'd better not say anything just yet.
Re: modifying the default application; it's only temporary. Assignment Servlets 4a introduces the concept of putting each application into its own root (context).
a war file set up for Tomcat should work with Orion? yes. War files are standardized so they should work with all the app servers.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Jan 26, 2005
It turns out to be easier to deploy a war file that is not the default servlet in Tomcat. To be specific I'm having problems getting Tomcat to expand a war file into the default servlet. At the same time it's easy to get Tomcat to expand a war file that is not a default servlet. Do you have a problem if I do the assignment by creating a war file that creates a non-default servlet?
Marilyn de Queiroz
Joined: Jul 22, 2000
It'll be ok as long as I can still run your code in Orion.
Joined: Jan 26, 2005
Thanks. While trying to deploy the war file as the default servlet, I managed to delete a number of files in the webapp\ROOT directory and I also apparently did something to some configuration files because my Tomcat no longer works. What fun. Now I'm trying to reload and configure Tomcat so I can use it again. I guess you can call this a good learning experience.