This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes using servlets to read data from JS windows Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "using servlets to read data from JS windows" Watch "using servlets to read data from JS windows" New topic
Author

using servlets to read data from JS windows

Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi,
i want to know if the following is possible:
in my HTML/JavaScript form, the final output is displayed in a window (say named as 'mywindow'). ie the window.open() and the document.write() functions are used to get the final ouptut. now, is it possible to use servlets to read and/or manipulate the contents of this window (ie mywindow)??
thanks in advance.
Greg T Robertson
Ranch Hand

Joined: Nov 18, 2003
Posts: 91
You should be able to feed the data from that window back to your servlet like you do with any other form. Assuming it's a form. Similarly if your window is being opened by another form it's contents could come originally from a servlet.
Sri Sar
Ranch Hand

Joined: Mar 25, 2004
Posts: 44
Hi greg,
thank u for the reply but i am afraid i will have to trouble u with one more question:
actually the content of my window is something like:
<choose>
<figure>C:\My Documents\ads.jpg</figure>
</choice>
now can i write a servlet that reads the content of the window and thus extracts the 'ads.jpg' file?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12324
    
    1
The only thing a servlet can see is a request, such as form submission. However, if your JavaScript is writing the document that is being shown, it can also write the same material to a variable that is submitted as part of a request.
Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: using servlets to read data from JS windows
 
Similar Threads
sometimes window not opened
A better structure for the classes
Firefox window open on unload
Jxam question on Frame and menubar
IE issue with setting action