if you mean during the init() method:

    /*
     * (non-Javadoc)
     * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig)
     */
    @Override
    public void init(ServletConfig config) throws ServletException {
        //
        ServletContext context = config.getServletContext();
        String path = context.getContextPath();

        super.init(config);
    }


Zsolt Koppany wrote:
> Hi,
> 
> I want to make the application contextPath independent. Normally this is not
> a problem because I can use request.getContextPath() however I need to know
> the contextPath during startup:
> 
> <servlet>
>       <servlet-name>startup</servlet-name>
>       <servlet-class>...</servlet-class>
>               <load-on-startup>1</load-on-startup>
>       </servlet>
> </servlet>
> 
> How can I do that?
> 
> Zsolt 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to