file download in spring mvc -


in home page want display user guide in 2 different format ( pdf , word) these documents created technical writers , want show download links these documents in home page after user logged in. can achieve putting these 2 documents in 1 folder 'web-inf' enable can download these files(without logging in). advise whats best way handle in spring mvc 2.5

i guess have security support, can check whether user logged in inside controller code.

then can put files /web-inf folder , create special controller serving these files logged users. controller check user logged in , forward request target file. in typical spring mvc configurations can forward request returning forward:/web-inf/myfile.pdf view name.

alternatively, if use security library, such spring security, can use features secure access files. in case don't need put them /web-inf , implement specifal controller accessing them.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -