Bookmark Topic Watch Topic
  • New Topic

How to display the retrive data in select drop down list.  RSS feed

 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Report post to moderator
Dear Sir/Madam,
The DATA IS SUCCESFULLY RETRIVE FROM data.txt (data.txt contains: Sumanta,Harish,Jiban).Sir my doubt is i want to display the same data in
select drop list.Could you please help me how to write it.

Please look my code mentioned in the below.


<tr>
<td>Subject of Issue
<select name="selName">
<option value="" selected>---Select the Issue---</option>

<%
try{
String theBR;
String txtValue = "";
File fin=new File("C:/TestData/data.txt");
FileReader fr=new FileReader(fin);
BufferedReader br=new BufferedReader(fr);
theBR=br.readLine();
String[] theSplit=theBR.split(",");
for(int i=0;i<theSplit.length;i++)
out.write(" - "+theSplit[i]);
}catch(Exception Ex){
System.out.println("exception in getting connection"+Ex.getMessage());
}
%>


</select>


Thanks and Regards,
Sumanta Panda
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Report post to moderator
Your other post wasn't closed. It was just moved to a more appropriate forum. Follow the link in big letters at the top of it.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
But this one is closed now. Here is the moved thread Joanne was talking about.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!