Basic Web Application¶
A basic example of a web application is available in the JODConverter Samples repository; the basic-webapp module.
The most important concept is that you should start your OfficeManager instance(s) when your webapp starts, stop it(them), when your webapp stops, and share it(them) across all requests. The OfficeManager(s) will take care of multi-threading.
The sample is a web application that uses the local module jodconverter-local-lo library of the JODConverter project, which means the jodconverter-local built with the LibreOffice dependencies.
Running the project using Gradle¶
First, build the project:
gradlew :samples:basic-webapp:build
Then, run:
gradlew :samples:basic-webapp:tomcatRun
If you experience a connection issue on Windows, you may have to set a system property pointing to a templateProfileDir where OpenGL is disabled by default. Read this to know how to disable OpenGL. Then, run:
gradlew :samples:basic-webapp:tomcatRun -Dorg.jodconverter.local.manager.templateProfileDir=<path to your directory>
Once started, use your favorite browser and visit this page:
http://localhost:8080/jodconverter-sample-webapp/
Happy conversions!!