Wesley Gilreath

Greenhorn
+ Follow
since Sep 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Wesley Gilreath

Thanks for the help. That worked alright. Just a little more debugging on my applet and it will be complete. Thanks again for the help.
Wes
21 years ago
Alright, I'm back.
Thanks for all your help. I'm a little rusty on the Servlets so if you could give me a hand I'd appreciate it. In the servlet, I just create a new URL object which is the site I want to pull the html from then I open the stream on that URL object and store the html read from the InputStream in a String variable. I then create a new PrintWriter object by calling the response.getWriter() and send the html source back to the applet by calling the println() method on the PrintWriter and pass the html source string into that println() method. How does that sound so far? Would that return the html source to the applet?
My next problem is how would my applet accept the string from the servlet. I'd create a string variable in the applet as well and set it equal to what?
Basically, how would I call the servlet from the applet? If you could provide some code example, that would be superb. If I'm still sounding a little sketchy or I'm not being clear enough, please let me know.
Thanks again,
Wes
21 years ago
Thanks for such a prompt response first off.
Ideally I'd like it to be just an applet with no servlets involved that I could just plug into any web page. However, I'm very opened minded and would like to hear how to use the servlet method you mention. I know how to write a servlet but how would you pass the string of parsed HTML from the servlet to the applet? Could I do the same using a JSP page instead of a servlet? I'd really like to hear how to do this or if you had a page or site that explains it you could just give me the URL and save some typing.
Once again, thanks for the help...
Wes
21 years ago
I have created an application and I'm turning it into an applet. It pulls html source from a website by using the openStream() method of the URL object. It parses through that html source and extracts sports scores. This works as a free standing application but when I try to run it as an applet, I get what appears to be an AccessControlException that appears to be thrown when the URL.openStream() method is envoked. If I'm not allowed to perform any I/O operations within an applet, how do i go about pulling the HTML source to parse through it?
Thanks,
Wes
21 years ago