使用poi提取word中的text,怎么让这个text在jsp显示时首行缩进并且分段?

使用poi提取word中的text,怎么让这个text在jsp显示时首行缩进并且分段?

                  FileInputStream in = new FileInputStream(filepath);
                HWPFDocument doc = new HWPFDocument(in);
                WordExtractor word = new WordExtractor(doc);
                String fileContent = word.getText();
                word.close();
                doc.close();
                in.close();
                    while (fileContent.indexOf("\n") != -1) {
                    fileContent = str.replace("\n","<br>");
                    }
                    while (fileContent.indexOf(" ") != -1) {
                    fileContent = str.replace(" ","&nbsp;&nbsp;");
                    }
                    System.out.println(fileContent);

这么写,只能做到分段,为什么没法首行缩进?求解答

https://download.csdn.net/download/qq_38361634/10775499