Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 48117 invoked from network); 31 Oct 2001 17:14:49 -0000 Received: from unknown (HELO osaka.betaversion.org) (192.18.49.133) by daedalus.apache.org with SMTP; 31 Oct 2001 17:14:49 -0000 Received: (qmail 20133 invoked from network); 31 Oct 2001 17:17:01 -0000 Received: from nagoya.betaversion.org (192.18.49.131) by osaka.betaversion.org with SMTP; 31 Oct 2001 17:17:01 -0000 Received: (qmail 27928 invoked by uid 97); 31 Oct 2001 17:14:30 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 27898 invoked by uid 97); 31 Oct 2001 17:14:29 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 27875 invoked by uid 50); 31 Oct 2001 17:14:28 -0000 Date: 31 Oct 2001 17:14:28 -0000 Message-ID: <20011031171428.27874.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 4362] - Reading init-params from a JSP should not need a servlet-mapping X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4362 Reading init-params from a JSP should not need a servlet-mapping ------- Additional Comments From craig.mcclanahan@sun.com 2001-10-31 09:14 ------- Remy's analysis of how init parameters work is correct. To put it in more general terms: * is a sub-element of . Therefore, initialization parameters belong to the particular servlet *definition* that is defined by that element. * Initialization parameter names and values are exposed (via the ServletConfig) object to any instance of that particular servlet definition that is exectued. (Note that it's legal to have more than one definition with the same servlet class -- the two definitions are unique. * It is legal to have zero or more rules that map requests to a particular definition. * The servlet container uses rules to select which servlet definition should process a request. Based on this selection, it follows the servlet lifecycle rules (single instance of the servlet class, call init() before the first request, and son on) and passes a ServletConfig object that corresponds to the definition on to that servlet. In the absence of a definition for a specific page, Tomcat uses a "*.jsp" URL pattern in a to map them to the default JspServlet. Therefore, every page mapped this way should see the init params for the standard JspServlet. But note that this is a consequence of the way that Tomcat happens to implement JSP -- you cannot count on it generally. The bottom line of all of this -- if you want to utilize servlet initialization parameters, you *must* define them in a definition, and you *must* provide a that selects that servlet definition. -- To unsubscribe, e-mail: For additional commands, e-mail: