Through apache commons I am uploading a file, I want to read all its content to a String and pass them to my JSP page through a RequestDispatcher.

How do I read the contents of the uploading file in String format?

有帮助吗?

解决方案

You could use:

FileUtils.readFileToString(File file)

from the commons-io package

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top