Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default How to get gif image "filename" using servlet.

    Hi,
    I have created servlet using netbeans, and running on browser, now since I am new to servlet, so I don't have a knowledge about servlet.
    Now my problem is :
    I have folder in
    C:\\cards\\playingcard
    . In this folder have 52 gif images. Now I want to get all the name in my servlet.
    Like one gif image name is
    2c.gif
    .
    This name I want to display in servlet. I have searching , and try to solve my problem, but still not solving, Please help me....how Can I solve this problem.

    I don't want to upload image,only I want to name like "2c.gif" , "3c.gif" on my console, and so on.....
    I have create a simple class its working properly but not this code working on servlet.....

    Last edited by ganesh.gothi@gmail.com; 06-01-2012 at 04:16 PM. Reason: Add more text.

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: How to get gif image "filename" using servlet.

    If you want to get all the file in a directory, check the java.io.File class. There is a method that will returns you an array of files available in the specified directory.

  3. #3
    Join Date
    Apr 2012
    Posts
    90
    Rep Power
    0

    Default Re: How to get gif image "filename" using servlet.

    Quote Originally Posted by wsaryada View Post
    If you want to get all the file in a directory, check the java.io.File class. There is a method that will returns you an array of files available in the specified directory.
    Sorry, I have created servlet context listener now I want to get .gif image from a folder which is on WEB directory of net-beans on servlet and store into the list with card image and also allot the integer value of each card, please help me how can I do this on ServletContextListener.
    Last edited by ganesh.gothi@gmail.com; 06-04-2012 at 09:47 AM. Reason: Add some more information.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,087
    Rep Power
    20

    Default Re: How to get gif image "filename" using servlet.

    What happened when you tried using methods available in java.io.File?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 02-01-2012, 08:37 PM
  2. Replies: 5
    Last Post: 12-21-2011, 06:44 PM
  3. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  4. Replies: 6
    Last Post: 10-27-2008, 12:25 AM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •