This is actually the configuration of the MIME download file type in the Web. xml file, the configuration example:
<mime-mapping> <extension>Doc</extension> <Mime-type>Application/msword</Mime-type> </mime-mapping> <mime-mapping> <extension>Xls</extension> <Mime-type>Application/msexcel</Mime-type> </mime-mapping> <mime-mapping> <extension>Pdf</extension> <Mime-type>Application/pdf</Mime-type> </mime-mapping> <mime-mapping> <extension>Zip</extension> <Mime-type>Application/zip</Mime-type> </mime-mapping> <mime-mapping> <extension>rar</extension> <Mime-type>Application/rar</Mime-type> </mime-mapping> <mime-mapping> <extension>Txt</extension> <Mime-type>Application/txt</Mime-type> </mime-mapping> <mime-mapping> <extension>Chm</extension> <Mime-type>Application/mshelp</Mime-type> </mime-mapping>
This prevents the browser from opening the file directly, but instead pops up the download box for the user to download.
Java prevents browsers from opening downloaded files directly