- Timestamp:
- 12/21/10 11:49:23 (17 months ago)
- Location:
- print/trunk
- Files:
-
- 2 modified
-
docs/installation.txt (modified) (1 diff)
-
src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
print/trunk/docs/installation.txt
r3675 r3714 153 153 3. Add a config.yaml file (from the `samples <https://trac.mapfish.org/trac/mapfish/browser/print/trunk/samples>`_, for example) to the root of your web application. 154 154 155 Configuring Servlet Temp Directory 156 ++++++++++++++++++++++++++++++++++ 157 By default the default servlet temporary directory will be used but that behaviour can be overridden setting the init-param *tempdir*. If this parameter is set the servlet must have write access to the directory. 158 155 159 Ruby on rails 156 ++++++++++++++ 160 ~~~~~~~~~~~~~ 157 161 158 162 TODO write the doc. 159 163 160 164 Command line 161 +++++++++++++ 165 ~~~~~~~~~~~~ 162 166 163 167 For debugging or calling from other environments, you can run the print module from the command line. -
print/trunk/src/main/java/org/mapfish/print/servlet/MapPrinterServlet.java
r3650 r3714 45 45 public class MapPrinterServlet extends BaseMapServlet { 46 46 private static final long serialVersionUID = -4706371598927161642L; 47 47 private static final String CONTEXT_TEMPDIR = "javax.servlet.context.tempdir"; 48 48 49 private static final String INFO_URL = "/info.json"; 49 50 private static final String PRINT_URL = "/print.pdf"; … … 364 365 protected File getTempDir() { 365 366 if (tempDir == null) { 366 tempDir = new File((File) getServletContext(). 367 getAttribute("javax.servlet.context.tempdir"), "mapfish-print"); 368 tempDir.mkdirs(); 367 String tempDirPath = getInitParameter("tempdir"); 368 if (tempDirPath != null) { 369 tempDir = new File(tempDirPath); 370 } else { 371 tempDir = (File) getServletContext().getAttribute(CONTEXT_TEMPDIR); 372 } 373 if (!tempDir.exists() && !tempDir.mkdirs()) { 374 throw new RuntimeException("unable to create dir:" + tempDir); 375 } 376 369 377 } 370 378 LOGGER.debug("Using '" + tempDir.getAbsolutePath() + "' as temporary directory");
