Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 12046 invoked from network); 2 Mar 2001 05:27:31 -0000 Received: from staff1.cso.uiuc.edu (root@128.174.5.59) by h31.sny.collab.net with SMTP; 2 Mar 2001 05:27:31 -0000 Received: from localhost (mepstein@localhost [127.0.0.1]) by staff1.cso.uiuc.edu (8.11.0/8.11.0) with ESMTP id f225RZt00528 for ; Thu, 1 Mar 2001 23:27:35 -0600 (CST) Date: Thu, 1 Mar 2001 23:27:35 -0600 (CST) From: Milt Epstein X-Sender: mepstein@staff1.cso.uiuc.edu To: tomcat-user@jakarta.apache.org Subject: Re: newbie servlet deploy question In-Reply-To: <3A9F0821.2F407935@lbl.gov> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Thu, 1 Mar 2001, Jason Novotny wrote: > I would like to be able to access a servlet with the URL > http://localhost:8080/demo > > However, it only works if I go to > http://localhost:8080/demo/servlet/demo [ ... ] How timely! I just joined the list yesterday, and this is exactly one of the questions I was going to ask, since I'm trying to do the same thing. I have managed to get close to what I want, but not quite. I tried some similar things as you with a context in the server.xml and with servlet names and mappings in web.xml without luck. However, I did find this question in the FAQ-o-matic at jakarta.apache.org: http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayQuestionAnswer/action/SetAll/project_id/2/faq_id/12/topic_id/43/question_id/532 It's a bit cryptic, but it suggests two ways of doing this: One, have an index page (jsp or html) that does a redirect to the servlet, or two, use Apache's mod_rewrite. Now, I tried the first of these, using both a META Refresh in an index.html file and a RequestDispatcher forward() in an index.jsp file, and it basically worked either way. That is, it got it to the right place from just a "http://localhost/demo" URL. The problem is that it changed the Location to "http://localhost/demo/servlet/demo", which I'd like to avoid. Now, I'm not familiar with mod_rewrite (and I don't currently have it installed), so I don't know if it provides a cleaner way to do this and/or avoids the above problem. Maybe you or someone else here knows the answer to that. Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) mepstein@uiuc.edu