- Timestamp:
- 2017-09-12T17:19:04+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/the-macronizer/trunk/src/java/web/servlets/DirectInput.java
r30061 r31962 23 23 import monogram.plugin.PluginConfiguration; 24 24 import monogram.plugin.PluginManager; 25 import org.apache.log4j.*; 25 26 26 27 /** … … 32 33 private final String UNEXPECTED_ERROR = "An unexpected error has occurred. Please try again or contact the web administrator if the problem persists."; 33 34 private final String UTF8_ENCODING = "utf-8"; 34 public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highlig ththe changes on the webpage output.35 public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highlight the changes on the webpage output. 35 36 private File tmpdir; 37 //Create an instance of the Logger object created for this class in log4j.properties 38 static Logger logger = Logger.getLogger(web.servlets.DirectInput.class.getName()); 36 39 37 40 @Override … … 86 89 File file = File.createTempFile("mi-tmp-", ".txt", tmpdir); 87 90 write(file, "utf-8", fragment); 88 91 89 92 //Create a fileview 90 93 PluginConfiguration configuration = new PluginConfiguration(); … … 107 110 RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher(path + "/main.jsp"); 108 111 dispatcher.forward(request, response); 112 //Generate an "info" level logger message including the input('fragment') and output('restoredFragment') 113 logger.info("Input:"+fragment+"Output: "+restoredFragment); 109 114 } catch (Exception e) { 110 115 request.setAttribute("errorMessage", UNEXPECTED_ERROR); 111 116 forward(path + "/error.jsp", request, response); 112 117 } finally { 113 114 115 restoredFile.delete();116 118 file.delete(); 119 if (restoredFile != null) { 120 restoredFile.delete(); 121 } 117 122 } 118 123 }
Note:
See TracChangeset
for help on using the changeset viewer.