Not exactly. When I used Orion server this was not a problem at all. I could make the refenense in the .jsp file like this: http::/server:1080/kjell/dir/files/result.xls and the user clicked the link, and did "save targer as...".
But it seems to be more complicated in JBoss.
By defining an external directory, you can supply a similar URL to enable downloads. All it takes is a simple configuration change.
For example, update the 'Host name="localhost"' entry in server.xml as follows:
<Host name="localhost" ...> <Context path="/docs" appBase="" docBase="/home/foo/docs" debug="99" reloadable="true"> </Context> ... </host>
Then if there is a file /home/foo/docs/design/xxx.odt, you can access it using http://hostname:8080/docs/design/xxx.odt.
Which server.xml file? I find at least 2 files. In ../server/all/deploy/jboss..tomvatt.sar and
Does the JBoss server have to be restarted?
The server.xml for the configuration you are running. If you don;t run a specific configuration, then the one in 'default'.
Yes, you must restart the server.
It worked! I can now download files from the exteral directory. One small problem: The files are of type .xls, but when the download dialog box appears the filetype is set to .htm. Anything I can do to change the filetype? The refererence in <a href.. is filename.xls
Try adding type="text/xml" to your < a > tag.
I have tried several combinations of type, type = "text/xml" "text/xls"
"xls", but the save dialog still use the filetype .htm
Her is how the html code is using view source:
<a href="Reports/ActiveUsers.xls" type="text/xml" target=_blank>Rapporten i excel-format ( Save Target As...)
If I take a "copy shortcut", the link looks like this:
But "Save as...", still names the file ActiveUsers.htm.
I have to rename the file to ActiveUsers.xls, and can then load the file into excel.
Sorry, I read the extension as .xml, not .xls. Try a type of "application/vnd.ms-excel".
Another thing to try. Add the following to the long list of mime types in server/xxx/deploy/jboss-web.deploy/conf/web.xml file:
<mime-mapping> <extension>xls</extension> <mime-type>application/vnd.ms-excel</mime-type> </mime-mapping>
At last it worked! Setting mime type in the web.xml file did it.
Thank you very much for the help you have provided.