tags:

views:

396

answers:

1

I am trying to write a code to download file from server. i am using file.list to display the file in the server so that the user can select it. My doubt is i want to insert a mark( small image)along file name,when the user clicks on the corresponding file name.How to perform this task

For Example

Pathfinder.exe
example.txt mozilla.exe

(When example.txt is clicked my Jsp must be like the below responce)

Pathfinder.exe
example.txt (An tick image must be inserted here)
mozilla.exe

A: 

You can use JavaScript to toggle the image on or off when the link is clicked without reloading the page. You may want to take a look at JQuery. If you want to do it with Java/JSP then you can have all of your file name links point to a servlet that will kick off the download, but also keep a list of the file names clicked in a session variable. You can then reload the page and use the session variable to determine which file names should have an icon next to them.

hoffmandirt