Re: Include Directive Misbehaving: Feedback for Mark Thomas
Justin Jaynes wrote: > Mark Thomas, > > To start on a positive note, I 've never found an open source project with > real help as accessable, as reliable, as knowledgeable, or as patient as I > have with Tomcat. I have access to amazing > support/discussion groups, with immediate communications to developers and > document writers. It's better than any product I've ever paid for. Thank-you on behalf of the entire community. > The definition of a context there is VERY VAGUE. And although it lists the > elements of a context, it gives NO EXAMPLES and no explanation of how to > create a context, and what a context does. It says what a context is, but > not what it does. The configuration documents are written assuming familiarity with a number of concepts, contexts being one of them. Have you read http://tomcat.apache.org/tomcat-5.5-doc/appdev/index.html ? It is intended to provide an introduction to all of the basics, including contexts. I have read through the application developers guide and I can't see any obvious gaps, but the gaps will be different for different people. If you, or anyone else, has suggested changes, additions or enhancements for the documentation I would be happy to look at them. One thing I do want to add is a virtual hosting how-to. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include Directive Misbehaving: Feedback for Mark Thomas
Mark Thomas, To start on a positive note, I 've never found an open source project with real help as accessable, as reliable, as knowledgeable, or as patient as I have with Tomcat. I have access to amazing support/discussion groups, with immediate communications to developers and document writers. It's better than any product I've ever paid for. I know you spend a LOT of time "with" end users. Thanks a million. You really make tomcat work for us. With your pointers I've been able to glean the info I needed and I've fixed my problem. I don't think there is any "wrong" info on the doc pages. But either I am not seeing everything there is to read, or there is a lack of explanation about contexts. I mean, really, I've been using tomcat for a few years and I learned the whole thing alone. Just me, a book, tomcat, and this list (I guess that's not really alone). And frankly, there is no reasonable explanation of what a context is. I feel like the documentation might be assuming I know more than I do. Me and anybody else who has very few resources to become introduced to tomcat. Where am I looking on the site? Well, I go to the tomcat page and click Configuration in the Reference section of links. I click on Context under the Containters section of links. The definition of a context there is VERY VAGUE. And although it lists the elements of a context, it gives NO EXAMPLES and no explanation of how to create a context, and what a context does. It says what a context is, but not what it does. Please consider revising the context page to make it clearer. If I had a firmer understanding, I would volunteer a revision myself. Justin - Original Message From: Mark Thomas <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Tuesday, November 7, 2006 10:27:38 PM Subject: Re: Include Directive Misbehaving Justin Jaynes wrote: > Oh snap! That's exactly what's happening. Can you point me to a good > document that expalins how to set up contexts? I've got everything set up > exactly as you described. > > Any good reading for a comprehensive (or even rudimetry) understanding would > be greatly appreciated. The on-line docs should have what you need. If we can id places where changes are needed then I'll get them incorporated. > If you can explain it in a reasonable length that is appropriate to this > forum (and convenient to your time), it would also be greatly appreciated. The short version is: - a context's docBase should never be the same as a host's appBase A suitable directory structure for multiple hosts could be: $CATALINA_HOME\host1-webapps -> Host1 appBase $CATALINA_HOME\host1-webapps\ROOT -> Default context for Host1 $CATALINA_HOME\host1-webapps\app1 -> Application on Host1 $CATALINA_HOME\host1-webapps\app2 -> Application on Host1 $CATALINA_HOME\host2-webapps -> Host2 appBase $CATALINA_HOME\host2-webapps\ROOT -> Default context for Host2 $CATALINA_HOME\host2-webapps\app3 -> Application on Host2 etc for as many hosts and applications as you like > The explanation in the doc on the tomcat.apache.org site seems to only cover > what I am using, which treats every director as a webapp. Definatly not what > I want. Which page(s) are you looking at? If the docs tell you to do this they need to be changed. I can't see anything like this but I could easily be missing the obvious. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include Directive Misbehaving
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Justin, Justin Jaynes wrote: > Oh snap! I just love it when people use that phrase! You just brightened-up my evening, Justin. > That's exactly what's happening. No wonder nothing makes sense. Glad you found your problem. Good luck. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFUlVq9CaO5/Lv0PARAmUyAJ9LSqqex1pTgaRFdfb0F3FYTGdm8ACfZaza YSKKVJbMPgMhVCGvhe+RsFQ= =/dAs -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include Directive Misbehaving
Justin Jaynes wrote: > Oh snap! That's exactly what's happening. Can you point me to a good > document that expalins how to set up contexts? I've got everything set up > exactly as you described. > > Any good reading for a comprehensive (or even rudimetry) understanding would > be greatly appreciated. The on-line docs should have what you need. If we can id places where changes are needed then I'll get them incorporated. > If you can explain it in a reasonable length that is appropriate to this > forum (and convenient to your time), it would also be greatly appreciated. The short version is: - a context's docBase should never be the same as a host's appBase A suitable directory structure for multiple hosts could be: $CATALINA_HOME\host1-webapps -> Host1 appBase $CATALINA_HOME\host1-webapps\ROOT -> Default context for Host1 $CATALINA_HOME\host1-webapps\app1 -> Application on Host1 $CATALINA_HOME\host1-webapps\app2 -> Application on Host1 $CATALINA_HOME\host2-webapps -> Host2 appBase $CATALINA_HOME\host2-webapps\ROOT -> Default context for Host2 $CATALINA_HOME\host2-webapps\app3 -> Application on Host2 etc for as many hosts and applications as you like > The explanation in the doc on the tomcat.apache.org site seems to only cover > what I am using, which treats every director as a webapp. Definatly not what > I want. Which page(s) are you looking at? If the docs tell you to do this they need to be changed. I can't see anything like this but I could easily be missing the obvious. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include Directive Misbehaving
Oh snap! That's exactly what's happening. Can you point me to a good document that expalins how to set up contexts? I've got everything set up exactly as you described. Any good reading for a comprehensive (or even rudimetry) understanding would be greatly appreciated. If you can explain it in a reasonable length that is appropriate to this forum (and convenient to your time), it would also be greatly appreciated. The explanation in the doc on the tomcat.apache.org site seems to only cover what I am using, which treats every director as a webapp. Definatly not what I want. Justin - Original Message From: Mark Thomas <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Tuesday, November 7, 2006 9:30:07 PM Subject: Re: Include Directive Misbehaving Justin Jaynes wrote: > To further complicate this problem, I have tried more experimenting and am > becoming more frustrated. I have just tested all combinations of files and included files for three levels of directories and everything is working as it should. Just a guess but... Is it possible your contexts are not correctly deployed? If your host's appBase and your web application's docBase point to the same directory and autoDeploy is enabled you will have all sorts of odd behaviour since by default *every* directory in a host's appBase gets deployed as a web application. HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include Directive Misbehaving
Justin Jaynes wrote: > To further complicate this problem, I have tried more experimenting and am > becoming more frustrated. I have just tested all combinations of files and included files for three levels of directories and everything is working as it should. Just a guess but... Is it possible your contexts are not correctly deployed? If your host's appBase and your web application's docBase point to the same directory and autoDeploy is enabled you will have all sorts of odd behaviour since by default *every* directory in a host's appBase gets deployed as a web application. HTH, Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Include Directive Misbehaving
To further complicate this problem, I have tried more experimenting and am becoming more frustrated. The original situation remains below. Now if I add a sub-directory to the admin subdirectoy, the directory structure looks like this: [main host directory (/host)] index.jsp header.jsp (ROOT VERSION, with a notation I can see in the html distinguishable from others) [admin sub directory (/host/admin) index.jsp header.jsp (ADMIN VERSION, with a notation) [user sub directory (/host/admin/user)] [justin sub directory (/host/admin/user/justin)] index.jsp As you can see, I have copied the header.jsp to the sub-directory admin and have altered its contets so I can identify which header.jsp is being used--namely that in the root directory or in the admin directory. Then in the index.jsp file in the justin subdirectory, I use the code <%@ include file="../../../header.jsp" %> to reach the ROOT header.jsp to be included. But instead, the output in the browser uses the file from the ADMIN directory. So I figured I should just add ../ once more to move one more level up. so I did. <%@ include file="../../../../header.jsp" %> But it used the ADMIN version again. <%@ include file="../../../../../../../../header.jsp" %> actually does too. What is the problem here? And trying to go less instead of more, <%@ include file="../../header.jsp" %> this also works but uses the ADMIN version. Which is the expected behavior FOR ONCE. But then even less <%@ include file="../header.jsp" %> gives this error: org.apache.jasper.JasperException: /sites/14/index.jsp(8,0) File "/sites/14/../header.jsp" not found org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Can someone try to reproduce this error? I believe that Tomcat 5.5 and 6.0 do not behave properly in this reguard. Unless I am making a mistake. If that is the case, please guide me out of it. Justin When I enter the same - Original Message From: Justin Jaynes <[EMAIL PROTECTED]> To: users@tomcat.apache.org Sent: Monday, November 6, 2006 10:01:00 PM Subject: Include Directive Hello, I am trying to eliminate unnecessary duplication of code by using include directives. Currently my directory structure is like this: [main app directory] index.jsp header.jsp footer.jsp [admin subdirectory] index.jsp The index.jsp file in the main directory contains the code <%@ include file="header.jsp" %> and it works great. In the admin directory the index.jsp file contains this code <%@ include file="../header.jsp" %> obviously referencing to the parent directory, where the header.jsp file sits. I don't want to have to copy it to the child directory and maintain two copies of it. But when I do this, I get an error every time. What am I doing wrong? You can find the error below. Justin HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /index.jsp(4,0) File "/../header.jsp" not found org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause org.apache.jasper.JasperException: /index.jsp(4,0) File "/../header.jsp" not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86) org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:339) org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:484) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1556) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211) org.apache.jasper.compiler.ParserController.parse(ParserController.java:100) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) org.apache.jasper.JspCompilationCon