Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding reading a file in a jsp

 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i am able to readthe data in a file(which contains some list of devices) through the following code.
But i need to show this data in a dropdown list after clicking a button in a HTML page.
How can i do that?



Thanks for your suggestion.

regards,
rama krishna.y
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4313
233
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a java class (not a JSP) to access the File, and store all the items you need to show up in a List or an array. Set that list/array as a request-score attribute when dispatching to the JSP. In your JSP, you can use JSTL for:each tag to iterate over that list/array and display each element as an item in your drop down list.
 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Devaka,

Thanks for your suggestion.
Now i am able to see the list in dropdown list in html.

regards,
rama krishna.y
 
yekkala krishna
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Devaka,

As we already discuss regarding loading of a file into a dropdown list.
Now in my application i need to load a file according to some option displayed in the dropdown list (contract list). and by clicking some button besides it.
Actually i am extracting contract name and filename from xml using DOM parser and doing viceversa.





regards,
rama krishna.y
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4313
233
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if I understand your requirement and the question. Is that viewMapTool.html a static html file? Also I can see a submit button outside your form - was that intentional?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic