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>                   <[EMAIL PROTECTED]>       
                    
                                               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:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>







--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to