I have a java application running Jetty, and containing several servlets and some beans. The whole thing is handled using a .war file.
The architecture is already pretty big, and I don't handle all its concepts yet, so please excuse my ignorance.
What I would like to do is extremely simple. I created a new servlet pointing to a url : filedl.
I would simply want to store a file in there, that the client can download For example for the url : myapp/filedl/my_file.txt
I only need some kind of directory listing, and allow access only to this directory.
Later, I'll think about adding authentification, but this is another problem.
The main issue here is that I get completely lost in all the concepts of Jetty, and googling jety download file returns loads of dumb results.
Any directions would be greatly appreciated !
Thx.
EDIT:
Thx to #npe, I am now able to donwload files. There is still a strange thing left though :
- I set the url-mapping as /filedl, but I can download files from / . I would like to allow dl in /filedl only
- Whatever file I download, it is named filedl.
- I don't have access to the file list (Error 500), even though I have
<init-param> <param-name>dirAllowed</param-name> <param-value>true</param-value> </init-param>
in my war file
Any idea where this is coming from ?
Thx again !