Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 70685 invoked from network); 7 May 2002 16:01:33 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 May 2002 16:01:33 -0000 Received: (qmail 14777 invoked by uid 97); 7 May 2002 16:01:09 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 14761 invoked by uid 97); 7 May 2002 16:01:08 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 14742 invoked by uid 98); 7 May 2002 16:01:08 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: Tue, 7 May 2002 11:01:02 -0500 From: Jacob Kjome X-Mailer: The Bat! (v1.54/10) Personal Reply-To: Jacob Kjome Organization: Springfield Nuclear Plant X-Priority: 3 (Normal) Message-Id: <15410513377.20020507110102@visi.com> To: "Tomcat Users List" Subject: Re[2]: Tomcat redirect In-Reply-To: <011201c1f5d9$137bbfb0$5c0ba8c0@taalee.com> References: <001a01c1f543$b991f950$5c0ba8c0@taalee.com> <20020507071755.A642@okidz.pindad.co.id> <011201c1f5d9$137bbfb0$5c0ba8c0@taalee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hello joshua, Well, actually, all you've done here is specify a context called "servlet" which has it's docbase sitting on the file system as "/spike/servlet". This would assume that you are on a Unix system and you have a directory called "spike" off the root of your sytem with a directory called "servlet" inside that. In this case, the address to your webapp would be: http://myserver.com/servlet/ However, I would avoid calling your context "servlet" because I think it will conflict with the default servlet mapping that Tomcat provides for you. In fact I think you are confusing the /servlet/* mapping that Tomcat provides for all webapps via its default web.xml with setting up a context. Let's assume that you place your new context in Tomcat's 'webapps" directory and it is called "myservlets". You can either not bother explicitly stating the for this webapp in the Server.xml and let Tomcat create a default one for it, or you can go ahead and specify it like this: The path says that requests to http://myserver.com/myservlets refer to a Tomcat-served Servlet context. The docBase says where the context's directory exists on the file system. Here, we are saying that it exists in the current directory (relative the webapps directory). You could also put this elsewhere on your file system, but you must then provide a path relative to webapps directory by saying something like "../../../../myservlets" which says "myservlets" is located 4 directories back from wherever the "webapps" directory exists or you can specify a hardcoded path like "C:\myapps\myservlets" on windows or "/myapps/myservlets" on Unix. Now with that set up, calling your servlet that redirects to another servlet might go something like this: http://myserver.com/myservlets/servlet/MyRedirectServlet which might redirect to another servlet "MyRedirectResultServlet" You'd have to make sure that the redirection goes to "/servlet/MyRedirectResultServlet" in order for Tomcat to catch this request as a request to this other servlet. Did that answer the question or am I missing something? Bottom line, rename your context to something other than "servlet" to avoid confusion. Jake Tuesday, May 07, 2002, 10:08:41 AM, you wrote: jw> I was hoping of something within the Tomcat configuration itself since we jw> don't use an index.jsp file. To be more specific about my problem, Whenever jw> a servlet calls another servlet in Tomcat it isn't intercepting the jw> /servlet/ directive and replacing it with /spike/servlet/ which is what it jw> should be doing. Perhaps I'm overlooking something obvious in the jw> configuration that will do this, but I've tried putting a jw> jw> docBase="/spike/servlet" /> jw> jw> Entry in the server.xml file, but that didn't seem to do it either... jw> Someone smack me with a clue stick and tell me what I'm doing wrong? jw> Josh jw> ----- Original Message ----- jw> From: "Oki DZ" jw> To: "Tomcat Users List" jw> Sent: Monday, May 06, 2002 8:17 PM jw> Subject: Re: Tomcat redirect jw> On 05/07 04:19 joshua wentworth wrote: >> I am trying to have Tomcat redirect certain requests to other applications >> or other sites. But I can't find anything in the documentation or in any jw> of >> the messageboards about any kind of forward or redirect function in jw> Tomcat. >> Is there such a function, and if so where can I find documentation on it? jw> You can use the following in my index.jsp, so that the main page will be jw> redirected to some other location: <% jw> response.sendRedirect(response.encodeRedirectURL("")); %>> jw> Oki jw> -- jw> To unsubscribe, e-mail: jw> jw> For additional commands, e-mail: jw> jw> -- jw> To unsubscribe, e-mail: jw> For additional commands, e-mail: -- Best regards, Jacob mailto:hoju@visi.com -- To unsubscribe, e-mail: For additional commands, e-mail: