简体   繁体   中英

Java jsp/servlet example to display list of image from web directory

I'm newbie in Java web development. Currently I'm writing a web page to display list of images stored in web directory using jsp/servlet. I want my page to display list of images in grid view (similar when we search image in google image function, results is displayed in grid view to user).

I tried to find some resources from internet to get ideal how to do it in java. But I'm still not yet found it.

Anyone who know any good examples about how to do it, please help in terms of

  1. Example links or solution material
  2. Possible approach / steps of how should I approach the problem

When you approach a problem try to break down the steps

  1. Retrieving the list of images

    a. Do you wish to write the code for storing the images or will you only need to fetch them

    b.For displaying First you need to get the data in your controller and the display it on the view

Can add more details to the analysis mentioned above

Update#1 Before going for a list can you try to simply fetch an image from the database (although in case of no of images in the list plenty of things have to be considered but we will deal with it later on ).

Now approach is

  1. Fetching an image from the database
  2. Getting it to your controller
  3. Displaying the fetched image to the view

Can you add some analysis to the mentioned steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM