Html-formatted documents are converted to word for download,
When the front-end uses the ueditor plug-in to allow users to input data and save it to the database. It can be used to print user input in another place. To save the ueditor in html format, convert the content in the background as follows:
1 @ RequestMapping ("ueditorPrintAction. do ") 2 public void uePrint (HttpServletRequest request, HttpServletResponse response) throws IOException {3 CivilParam param = new CivilParam (); 4 param. setParamData (null); 5 CivilResult result = ueditorPrintService. queryContext (param); 6 map = (Map) result. getResultData (); 7 // The above is through pring dubbo for database query 8 String htmlContent = map. get ("content "). toString (); 9 // character replacement 10 htmlContent = htmlContent. replaceAll ("'Lt '", "<"); 11 htmlContent = htmlContent. replaceAll ("'gt '", ">"); 12 htmlContent = htmlContent. replaceAll ("'quot '", "\" "); 13 htmlContent = htmlContent. replaceAll ("'#39'", "'"); 14 15 String content = "View Code