wood burning stoves
The moose likes Servlets and the fly likes posting data not using a form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "posting data not using a form" Watch "posting data not using a form" New topic

posting data not using a form

dibs dibley

Joined: Aug 31, 2003
Posts: 13
I want to post data to a cgi file, but instead of using a form my servlet will retrieve the information from a database!
Anybody have any ideas on how this can be done?

Thanks in advance.
Faisal Khan
Ranch Hand

Joined: Jun 29, 2003
Posts: 285
If I understood you correctly, then at loading a page, you want to pull some data from the database and then submit the form to some place.
This is nothing to do with servlets as far as I can see but here is how you can do this...
1. Pull out the data from database and place it into hidden form fields
2. At the end of the page have a javascript submit() command to submit the form to where ever.

The secret to creativity is knowing how to hide your sources.
dibs dibley

Joined: Aug 31, 2003
Posts: 13
The servlet will send some particular data from the database to the cgi program depending on what checkbox is clicked on a jsp page.
I'd like to do this without using javascript, is there any way?
raj lakshmi

Joined: Sep 03, 2003
Posts: 7
Hi What I could understand from ur message is u wnat to pass some values to a cgi frm a servlet right.........
If so
after retrieving values from database those variables can be put into session i mean Servlet Session i dont know exactly the syntax but when u can programmitically put into session variable and then retrieve in the cgi file be it a servlet using servlet context.......
Hope my answer is relative........
I agree. Here's the link: http://aspose.com/file-tools
subject: posting data not using a form
It's not a secret anymore!