wood burning stoves 2.0*
The moose likes Servlets and the fly likes Form Data from Applet-Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Form Data from Applet-Servlet" Watch "Form Data from Applet-Servlet" New topic
Author

Form Data from Applet-Servlet

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
This may be a simple question.
I have a checkboxgroup of four choices and a submit button in my applet. I'm not sure how to encode the information and send it to the servlet. Could someone give a basic example of how it would be encoded int the applet? Thanks alot. I understand how to handle it in the servlet, but I'm going wrong somewhere on the front end and I suspect that it is in the encoding value part.
Thanks,
Sean
Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
There's an example that does this on http://www.coreservlets.com/ in the source code archive.
Julia
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
yeah, there's an example, but the example doesn't use checkboxes, and I've been having a hardtime trying to execute it with checkboxes.
nan sh
Ranch Hand

Joined: Jan 05, 2001
Posts: 167
And, I found examples are very hard to follow.


Have you tried this Mock Exam Testing Engine yet?<br /><a href="http://www.mycgiserver.com/~nan111/index.html" target="_blank" rel="nofollow">www.mycgiserver.com/~nan111/index.html</a>
Julia Reynolds
Ranch Hand

Joined: May 31, 2001
Posts: 123
What if you put four strings in the request and set their values to "True" or "False" based on the check box? Then you could post to the servlet and read out the values and set your database flags accordingly.
Julia
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
I'm not using a database. Maybe I should give you more information. I have a poll on my webpage right now. The front end is in html and consists of 5 radio buttons and a submit button. This gets submitted to my servlet through the html. The servlet then updates the results in a file called survey.txt and then returns the results in an html page. Instead of returning the results into an html page, I am trying to return them to my applet. For the applet I used a checkboxgroup consisting of five checkboxes, and only one can be checked. I am having trouble encoding this form data and submitting it to the servlet and then getting the results back to the applet. I thought this would be pretty easy to do with http tunneling, but I'm not sure how to do it with form data. Now that I think about it, using a database would probably be much easier, but I would still like to know how to http tunnel form data. Thanks for your responses though. I wonder if I should get another Servlet book. I'm using the core book.
- Sean
 
 
subject: Form Data from Applet-Servlet