AllExperts > JSP - Java Server Pages 
Search      
JSP - Java Server Pages
Volunteer
Answers to thousands of questions
 Home · More JSP - Java Server Pages Questions · Answer Library  · Encyclopedia ·
More JSP - Java Server Pages Answers
Question Library

Ask a question about JSP - Java Server Pages
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About k2patel
Expertise
Only based on the pure jsp and the taglibs related question`s I can answer up to expert level. Do not ask me question regarding to the servlet

Experience

Past/Present clients
shhhhhhhh...

 
   

You are here:  Experts > Computing/Technology > Focus on Java > JSP - Java Server Pages > Read text file into your JSP

JSP - Java Server Pages - Read text file into your JSP


Expert: k2patel - 12/13/2005

Question
Hi,

Were you able to get your JSP page to read your text file? I'm trying to do the same thing.
I want to take the values after is parsed and create an array, and somehow I need the array to be the source for my drop down list.
Please help if you can.



Thanks,
Youssef

Answer
first time i'm helping some one with code and don't ask me more for code. now u can put the line in the array and arrange your text file in a way each line is a value of the drop box

i think this will help you
<%
BufferedReader input = new BufferedReader(new FileReader("prueba.txt"));
String line = "";
while ((line = input.readLine()) != null) {
   out.println(line);
}
output.flush();
input.close();
%>

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.