xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Esse <e...@widenarrow.se>
Subject Re: Relative paths when running FOP as servlet (Tomcat)
Date Wed, 25 Aug 2010 14:52:30 GMT

Hi Martin! 

Thanks a lot for your help! However, i'm really a rookie and i need some
clarification to understand :) 

How should i modify my web.xml(below)? Should i just add the
<context-param>- and <listener>-part to the web.xml? 

I do not fully understand what to do with the listener and how to do it...
where do i put the listener? 

Im not really used to Java, so all of this is sort of new to me. 

        <!-- Servlets --> 
  <!-- Servlet mappings --> 

Martin Jacobson wrote:
This is what I would do... 

0) move the config file to be part of the war file, inside WEB-INF 

1) web.xml 

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 

    <display-name>cartoWeb - vector map server</display-name> 



2) Listener 

public class WebAppInitializer implements ServletContextListener 
        ServletContext ctx = null; 

        public void contextInitialized(ServletContextEvent sce) 
                ctx = sce.getServletContext(); 
                String configFileName =
                String realConfigFile = ctx.getRealPath(configFileName); 
               try { 
                     fopFactory.setUserConfig(new File(realConfigFile)); 


View this message in context: http://old.nabble.com/Relative-paths-when-running-FOP-as-servlet-%28Tomcat%29-tp29531194p29533202.html
Sent from the FOP - Users mailing list archive at Nabble.com.

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message