This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Well, tempfiles aren't usually held in memory, but if you want to create a temporary file and not care whether it's in memory or on disk, then createTempFile is a good choice.
There's nothing in JSF that is specific to temp files, but J2EE containers usually override the tempfile directory location that the JVM would be using by default. For example, on a Linux system, instead of /tmp, it would be set to TOMCAT_HOME/work, unless you overrode the override.
An IDE is no substitute for an Intelligent Developer.