struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghuveer" <raghuve...@infotechsw.com>
Subject application folder name in webapps folder in tomcat through struts plugin
Date Wed, 02 Apr 2008 16:15:12 GMT
I have done this this requirement in org.apache.struts.action.PlugIn.

Here also I am getting

 

public void init(ActionServlet actionServlet, ModuleConfig config) throws
ServletException {

            Properties _ini_config = new Properties();


            try {

                        String
strContext=actionServlet.getServletContext().getServletContextName();  

                        System.out.println("strContext="+strContext);

            } catch (Exception ex) {

                        System.out.println("Error !"+ex);

            }          

}          

 

 

 

 

I have HelloServlet ,HelloServletContextListener in 3 different applications
in tomcat

<tomcat_home>webapps\AppHello1
<tomcat_home>webapps\AppHello2
<tomcat_home>webapps\AppHello3

How to identify in my listner class what is the folder/context name in my
server.

public void contextInitialized(ServletContextEvent ce) {
contextName = ce.getServletContext().getServletContextName();
}


This code is working only if i have
<display-name>AppHello1</display-name> in web.xml.
If there is no <display-name> in web.xml then above code in listner class is
returning null.

Is there facility to know application folder name in webapps folder in
tomcat.

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message