I want to be able to be on a page and have a favorite that points to http://localhost/export which is a web service. When I select that favorite, the current web page Im on should send all of its source code to the web service. The web service should "chop it up" and then return a excel document that should be downloadable.

I know how to do the web service and possibily how to chop up the code, manipulate it, and return the excel document that should be downloadable. I just dont know how I click that link in my favorites that gets all of the current page's source code and sends it to the web service to manipulate ti.

How can I do this?


Your question seems to be related to JavaScript more than Java.

You may need to use Javascript with Ajax. You need a link or button on that page for user to start the export process. Once click, use JavaScript to grab the inside HTML tag content (innerHTML value) and send it to the server. The idea is that in general, a web page would have only one HTML tag to display a web page content. This is not always true but in general. The innerHTML content is the source code of the viewing page, so this should at least work in most cases.

PS: If the page is displayed using javascript or flash, the source code may be different from what you see.