• Post Reply Bookmark Topic Watch Topic
  • New Topic

using JSP to read from js window

 
Sri Sar
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate 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
Eclipse IDE Hibernate 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!