Results 1 to 4 of 4
- 06-01-2012, 03:01 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 90
- Rep Power
- 0
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. In this folder have 52 gif images. Now I want to get all the name in my servlet.C:\\cards\\playingcard
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.
- 06-01-2012, 05:36 PM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
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.
Website: Learn Java by Examples
- 06-04-2012, 09:44 AM #3
Member
- Join Date
- Apr 2012
- Posts
- 90
- Rep Power
- 0
Re: How to get gif image "filename" using servlet.
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.
- 06-06-2012, 11:09 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,460
- Rep Power
- 16
Similar Threads
-
loop "play again" in an 8 ball game , loops but wont let me answer my "out.print"
By IareSmart in forum New To JavaReplies: 1Last Post: 02-01-2012, 08:37 PM -
Got struck with this :- " Exception in thread "main" java.lang.NullPointerException"
By Vermont in forum New To JavaReplies: 5Last Post: 12-21-2011, 06:44 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
Error! "filename" is not abstract and does not override abstract method...
By hasani6leap in forum New To JavaReplies: 6Last Post: 10-27-2008, 12:25 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks