tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rseque...@transentric.com
Subject Re: Context path
Date Thu, 19 Sep 2002 18:29:21 GMT

Place an environment entry in the web.xml. This way you can access this
parameter anywhere, anytime. Don't depend on getContext or
getServletContext methods. If you had a war file, a getServletContext
returns null.

RS



                                                                                         
                 
                      "Andreas Probst"                                                   
                 
                      <email@andreaspro        To:       Tomcat Users List            
                    
                      bst.de>                   <tomcat-user@jakarta.apache.org>
                          
                                               cc:                                       
                 
                      09/19/02 07:23 AM        Subject:  Context path                    
                 
                      Please respond to                                                  
                 
                      "Tomcat Users                                                      
                 
                      List"                                                              
                 
                                                                                         
                 
                                                                                         
                 




Hi all,

I need to know the context path of my web app. If I have a

HttpServletRequest req, I can get
String contextPath = req.getContextPath();

Now, what can I do within init()? I havn't got a
HttpServletRequest there. How do I get the context path?

Thanks in advance.

Andreas


--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>







--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message