• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

extracting data using servlets

 
Ella Rath
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i need a small clarification regarding servlets:
using a HTML/JS form, my output is a new window named mywin with the following contents:

<details>
<desc>C:\Project\abc.svg</desc>
<notes>C:\Project\data.txt</notes>
</details>

now i want to use a servlet to extract the contents of the window (mywin)
can u help me by giving a sample servlet code that extracts the data as above?
thanks in advance..
 
Mike Nightsky
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it looks like more a xml file than an html-window.
if you couldn't submit the window (-> sending the windwo content back to the server) the server never gets grip on the data.
i suggest to build a form with this code in it:

<input type="hidden" name="desc" value="C:\Project\abc.svg">
<input type="hidden" name="notes" value="C:\Project\data.txt">
and then put a form around and display the information and a subitbutton to send it back.
Then you could get it in the servlet by get it from the request with req.getParameter("desc"/"notes") and you get a String back with either the desc-value or the notes-value.
Hope that helps.
Mike :roll:
[ May 26, 2004: Message edited by: Mike Nightsky ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic