Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Regarding reading a file in a jsp

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 6746
1278
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 6746
1278
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic