loading folders name in a combo box.

Posted on 2003-11-10
Last Modified: 2010-04-01
In a jsp page i am storing a value in a varaible name month ie,
String month = request.getParameter("MONTH");
here i'm getting the value like jan,feb...dec.
In some path eg: e:/reports ... I'm having a bunch of reports with folder strutures  like
 here 20030705 is year month date .. 2003 is year 07  is month and last one 05 is date..
 like that 121212 is hour min sec...
What i have to do is...
After i get jul(for july) in a month variable , i have to get all the folders name which is created on july (only 4 in the above 6) and load it in a combo box so that after submit for a particulat date ...say 20030705 .. i have to load the time (here we have two time folder for that date ) in a combo box and ask the user to select the particular time folder .

Can any one help me ...
Thanks in advance..
regards Arunkumar

Question by:rarunk
  • 2
LVL 19

Accepted Solution

Kuldeepchaturvedi earned 100 total points
ID: 9720989
Once you get the the month here is what you will have to do..
String[] arr={"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"};
String month=request.getParameter("MONTH");
int i=0;

File f = new File("e:\\reports");
String fnames[]=f.list();
<SELECT NAME='MySelect">
for(int j=0; j<fnames.length; j++)
File temp=new File("e:\\reports\\"+fnames[j]);
int mon = Integer.parseInt(fname[j].substring(4,6));

I don't vouch for the correctness of the code written above but it should give you a very clear idea as what is to be done..
Above code may have some syntax error but in essence the logic is there..
do let me know if I can be of more help.

Author Comment

ID: 9721427
hi Kuldeepchaturvedi
 It's more than enough for me..
 It's exact what i want...Thanks a lot..
LVL 19

Expert Comment

ID: 9721649
Glad to be any of help to you....:-)

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jersey maven project error 7 141
nested if has else if 13 94
javax.naming.NameNotFoundException: Name ... is not bound in this Context. 6 262
spring JDBC Template example error 26 238
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question