• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

using JSP to read from js window

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
in my html/javascript form, the output is a javascript window with a set of XML tags like
<emp>
<na>C:\abc.txt</na>
<ag>C:\fig.svg</ag>
</emp>

how can i write a JSP code that, on form submission, gets the above window as input and extracts the data present in the path specified by the tags.
thanks in advance
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put your xml string in a hidden form element and submit the form. Its now part of the request, so your server code can retrieve it.
 
Sri Sar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi paul,
thank u very much for the reply. i am working using the idea u suggested. now i need one more clarification from u.
once my jsp receives the request from the hidden form element, is it possible to do the following:
in my xml tags, i had mentioned two file paths:"C:\abc.txt" and "C:\fig.svg"
now how can i write an JSP code that takes the data from the "abc.txt" file and applies that values on the "fig.svg" file.
say for eg, "fig.svg" is a map of a country, whereas "abc.txt" is a text file that contains the names of the various states in that country with their population values. now i want to map the population values onto the svg map. how can it be done.
some sort of sample code will be quite helpful.
thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used Scalable Vector Graphics, so I can't help you with that part of it. However, if you are submitting two file names through a form, I assume you also want those files to be uploaded to your server? Or are they already there? If they are not, you would have to stream the contents up to your server and handle them there. You stream things up with an input form element of type "file", and you would handle the file with the usual java.io classes.
 
Well THAT's new! Comfort me, reliable tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic