سؤال

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