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

web-app>
        <!-- Servlets -->
  <servlet>
    <servlet-name>Fop</servlet-name>
    <servlet-class>org.apache.fop.servlet.FopServlet</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>FopPrint</servlet-name>
    <servlet-class>org.apache.fop.servlet.FopPrintServlet</servlet-class>
  </servlet>
  <!-- Servlet mappings -->
  <servlet-mapping>
    <servlet-name>Fop</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>FopPrint</servlet-name>
    <url-pattern>/fopprint</url-pattern>
  </servlet-mapping>
</web-app>




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"
>     "http://java.sun.com/j2ee/dtds/web-app_2.3.dtd";>
> 
> <web-app>
>     <display-name>cartoWeb - vector map server</display-name>
> 
>       <context-param>
>               <param-name>configuration-file</param-name>
>               <param-value>WEB-INF/fop.xconf</param-value>
>       </context-param>
> 
>       <listener>
>       
> <listener-class>com.emc.carto.web.servlet.WebAppInitializer</listener-class>
>       </listener>
> ...
> 
> 2) Listener
> 
> public class WebAppInitializer implements ServletContextListener
> {
>       ServletContext ctx = null;
> 
>       public void contextInitialized(ServletContextEvent sce)
>       {
>               ctx = sce.getServletContext();
>               String configFileName = 
> ctx.getInitParameter("configuration-file");
>               String realConfigFile = ctx.getRealPath(configFileName);
>                try {
>                      fopFactory.setUserConfig(new File(realConfigFile));
>               }
> etc.
> 
> 
> HTH
> Martin
> 
> 
> 
> 
> On 25 August 2010 14:25, Esse <[email protected]> wrote:
>>
>> Hi fopusers!
>>
>> Specs:
>> Latest fop (1.0)
>> Latest tomcat (7.x)
>>
>> I’m using the fop servlet example in tomcat, with a config file.
>>
>> Right now, FOpServlet is modified like this:
>>
>> protected void configureFopFactory() {
>>        try {
>>                fopFactory.setUserConfig(new File("/conf/fop.xconf"));
>>        } catch (SAXException e) {
>>                System.out.println(e);
>>        } catch (IOException e) {
>>                System.out.println(e);
>>        }
>>    }
>>
>> However, the path for the config file in the above example is
>> C:\conf\fop.xconf .
>>
>> How to make config file path relative(in jar/war/tomcat folder?
>>
>> Really anywhere would do except a hard path, like
>> [JAVA_HOME]/conf/fop.xconf
>> or something like that.
>>
>>
>> Please help :)
>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Relative-paths-when-running-FOP-as-servlet-%28Tomcat%29-tp29531194p29531194.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
> 
> 
> 
> -- 
> From my MacBook Pro
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to