directory organization advice
Can anyone give me some quick advice on how to appropriately organize my directory structure to have Apache serve up the static content (images and html files) and Tomcat serve up the dynamic content (JSP files,etc). For simplicity, consider the sample webapp (myapp) given in the tomcat documentation consisting of the following files as deployed on my win2000pro box (ignoring the servlet for simplicity) C:\tomcat\webapps\myapp\index.html C:\tomcat\webapps\myapp\hello.jsp C:\tomcat\webapps\myapp\images\tomcat.gif With Tomcat plugged into Apache, does Apache automatically serve up the static content (index.html,tomcat.gif)when it is located under the myapp directory? Or do I have to place the static content somewhere other than under the webApp directory for Tomcat. Would I need to place index.html and images\tomcat.gif under the doc-root for Apache outside of the webApp for Apache to serve it up? Another way of asking this is when I deploy the myapp sample with Tomcat plugged into Apache and the static content is served up, is it Tomcat that serves it up or is it Tomcat that is serving it up when the static content is located under C:\tomcat\webapps\mayapp... Thanks in advance... -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Repost: tomcat 3.3-M2 /admin/contextAdmin/contextList.jspfailure Date: Mon, 09 Apr 2001 10:14:51 +1000 From: Peter B. West pbwest@powerup.com.au Organization: Repost: tomcat 3.3-M2 /admin/
Please file a bug in http://nagoya.apache.org/bugzilla I will revise the Admin app ASAP.. Thanks for the feedback Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]En nombre de Peter B. West Enviado el: lunes 16 de abril de 2001 5:53 Para: [EMAIL PROTECTED] Asunto: Repost: tomcat 3.3-M2 /admin/contextAdmin/contextList.jspfailure Date: Mon, 09 Apr 2001 10:14:51 +1000 From: "Peter B. West" [EMAIL PROTECTED] Organization: Repost: tomcat 3.3-M2 /admin/cont Any takers (or takes) on this one. I posted it a few days ago. The problem does not seem to be with the authentication, but with the refereneces to the Logger class. Peter I have been trying to set up a JBDCRealm using postgresql 7.0.2 under redhat linux with tomcat 3.3-M2. I got the authentication to work, but ran into the following problem when trying to access the Context List. Error: 500 Location: /admin/contextAdmin/contextList.jsp Internal Servlet Error: java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/Logger at contextAdmin.contextList_1._jspService(contextList_1.java:67) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandl er.java:500) at org.apache.tomcat.core.Handler.service(Handler.java:223) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler .java:448) at org.apache.tomcat.core.ContextManager.internalService(ContextM anager.java:788) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:701) at org.apache.tomcat.modules.server.Ajp13Interceptor.processConne ction(Ajp13Interceptor.java:162) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi nt.java:424) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:497) at java.lang.Thread.run(Thread.java:498) Looking in container/tomcat_util.jar, I see org/apache/tomcat/util/qlog/Logger.class, but no log/Logger.class. Is this the problem? If so, how do I fix it (being new to java)? Peter -- Peter B. West [EMAIL PROTECTED] http://powerup.com.au/~pbwest "Lord, to whom shall we go?"
Repost: tomcat 3.3-M2 /admin/contextAdmin/contextList.jspfailure Date: Mon, 09 Apr 2001 10:14:51 +1000 From: Peter B. West pbwest@powerup.com.au Organization: Repost: tomcat 3.3-M2 /admin/contextAdmin/contextList.jspfailure
Any takers (or takes) on this one. I posted it a few days ago. The problem does not seem to be with the authentication, but with the refereneces to the Logger class. Peter I have been trying to set up a JBDCRealm using postgresql 7.0.2 under redhat linux with tomcat 3.3-M2. I got the authentication to work, but ran into the following problem when trying to access the Context List. Error: 500 Location: /admin/contextAdmin/contextList.jsp Internal Servlet Error: java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/Logger at contextAdmin.contextList_1._jspService(contextList_1.java:67) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:500) at org.apache.tomcat.core.Handler.service(Handler.java:223) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:448) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:788) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:701) at org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Ajp13Interceptor.java:162) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:424) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:497) at java.lang.Thread.run(Thread.java:498) Looking in container/tomcat_util.jar, I see org/apache/tomcat/util/qlog/Logger.class, but no log/Logger.class. Is this the problem? If so, how do I fix it (being new to java)? Peter -- Peter B. West [EMAIL PROTECTED] http://powerup.com.au/~pbwest "Lord, to whom shall we go?"
Re: organization
A couple of comments. First of all, source files go wherever you want them. If you want them in the same place as your class files, you may certainly do so, but I can't think of any good or even not so good reason why you should. As to the other part of what you've heard, I'd suggest getting the servlet 2.2 spec and reading it. There are actually two possible directories (directories, not files) that can go in the WEB-INF directory at the same level as the web.xml file. The directories are classes and lib. I tend mostly to write packages that I store in a jar file, and that constitutes a library and goes in lib. In dividual class files go in classes, but you could have a hierarchy under classes as well. The reason it doesn't get "messy" is because you will normally have a number of such structues. What they define is a single application, not a single servlet. Any application beyond the very simple-minded HelloWord.class demonstration webapp is bound to involve more than one servlet, and possibly a mixture of servlets, jsp pages, and static html. All of these go into a single directory structure. Statis pages as well as most jsp pages typically live in the root of the specific application hierarchy, which is at the same level as the WEB-INF directory. There is no rule that regulates the definition of an application. You could consider all the webapps you ever write for any particular (virtual) server to be a single application, but you could also just as easily define individual application in terms of a single function and under that application's root, keep only those static pages, jsp's and servlets that serve that particular function. For example, I manage the central computing services for Linfield College. Creating email accounts, password management, setting and resetting forwards and vacation are all handles on line, and all the servlets/jsp's that do the work are part of a single application. We also provide email lists for every section of every course taught. Those email lists are populated initially from the add drop records. But faculty also want the ability to see who's subscribed and who's not (students who don't have a Linfield email address are not subscribed until they apply for an email address -- the subscription record simply uses their student id as a place holder). Faculty also want to be able to look at the list of subscribees and send messages to a select subset. All but the initial population of the lists is handles through the web, and the servlets/jsp's that do the work are bundled together as an application separate from the account management application. The point is that it's not messy because applications are separated from one another. Actually, it's cgi's that get messy. The application structure used for servlets is much cleaner. -- Rob --On Tuesday, March 13, 2001 11:15:14 PM + [EMAIL PROTECTED] wrote: Hi, from my understanding, all compiled classes of servlets have to go in a file called 'classes' in the same directory as the 'web.xml' file in 'Web-inf' directory. And from what I heard all corresponding java sources should go in there to. Now if all files ( source java files and classes files ) go in the one directory called classes wouldn't it get really messy putting everything in one file. Does anyone have any better suggestion for organizing this problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] _ _ _ _ __ _ _ _ _ /\_\_\_\_\/\_\ /\_\_\_\_\_\ /\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT, /\/_/__\/_/ __/\/_//\/_/ PROFUNDUM VIDITUR /\/_/_/_/_/ /\_\ /\/_//\/_/ /\/_/ \/_/ /\/_/_/\/_//\/_/ (Whatever is said in Latin \/_/ \/_/ \/_/_/_/_/ \/_/ appears profound) Rob Tanner McMinnville, Oregon [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: organization
You can create application specific web-inf dir so that the class files lib will be organized neatly. For example the following additional code helps Tomcat to pick up classfiles and lib from c:/abc/infodir/codebase/web-inf dir. Add the following lines inServer.xml Context path="/infodir" docBase="c:/abc/infodir/codebase" crossContext="true" debug="0" reloadable="true" trusted="false" /Context ...other Context [docBase tells the web-inf dir for "infodir"] Andyou should have the following directory structure c:\abc\infodir\codebase\Web-Inf\classes \lib The web.xml specific to the servlet should be in the same directoryc:\abc\infodir\codebase\Web-Inf\web.xml Harish
organization
Hi, from my understanding, all compiled classes of servlets have to go in a file called 'classes' in the same directory as the 'web.xml' file in 'Web-inf' directory. And from what I heard all corresponding java sources should go in there to. Now if all files ( source java files and classes files ) go in the one directory called classes wouldn't it get really messy putting everything in one file. Does anyone have any better suggestion for organizing this problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: organization
On Tue, 13 Mar 2001 [EMAIL PROTECTED] wrote: Hi, from my understanding, all compiled classes of servlets have to go in a file called 'classes' in the same directory as the 'web.xml' (classes is a directory, not a file -- probably what you meant to say.) file in 'Web-inf' directory. And from what I heard all corresponding java sources should go in there to. Now if all files ( source java files and classes files ) go in the one directory called classes wouldn't it get really messy putting everything in one file. Does anyone have any better suggestion for organizing this problem. I don't see why the java source files have to go there. In fact, I'd think it would be a bad idea. You could put them anywhere, really, and use an appropriate javac command to get the compiled class files into that classes directory (i.e. using the -d option). Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]