tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rseque...@transentric.com
Subject Re: Re[2]: Context path
Date Fri, 20 Sep 2002 12:56:36 GMT

Jake, you are correct. Guess I was high on dope, huh :-) But I suppose one
could still use the environment entry technique for "root" contexts.
Thanks

RS



                                                                                         
                 
                      Jacob Kjome                                                        
                 
                      <hoju@visi.com>          To:       "Tomcat Users List"       
                       
                                                <tomcat-user@jakarta.apache.org>   
                       
                      09/19/02 05:29 PM        cc:                                       
                 
                      Please respond to        Subject:  Re[2]: Context path             
                 
                      "Tomcat Users                                                      
                 
                      List"                                                              
                 
                                                                                         
                 
                                                                                         
                 




Hello rsequeira,

I think you are mistaking getServletContext with getRealPath("/").
The servlet context object is too important to *ever* return null.  It
is only file system operations that will not work when the context is
deployed in a .war file.

Jake

Thursday, September 19, 2002, 1:29:21 PM, you wrote:


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

rtc> RS




rtc>                       "Andreas Probst"

rtc>                       <email@andreaspro        To:       Tomcat Users
List
rtc>                       bst.de>
<tomcat-user@jakarta.apache.org>
rtc>                                                cc:

rtc>                       09/19/02 07:23 AM        Subject:  Context path

rtc>                       Please respond to

rtc>                       "Tomcat Users

rtc>                       List"







rtc> Hi all,

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

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

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

rtc> Thanks in advance.

rtc> Andreas


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







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



--
Best regards,
 Jacob                            mailto:hoju@visi.com


--
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