Jump to content

  • Log In with Google      Sign In   
  • Create Account


[java] Applet/Servlet communication


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Icculus   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 August 2000 - 12:17 PM

Can someone give me a hand in applet/servlet communication. I can only find one source http://gamelan.earthweb.com/journal/techworkshop/020300_appserv2.html and this code I have played with but I can''t get his code to work by itself or integrated with mine. I have tried using Sockets and this works great in AppletViewer, but in IE I am getting SecurityExceptions. Can someone give me some code or a source for this type of thing without having to set permissions up to do it. Note that I don''t want the servlet to send back a html doc like all the tutorials but a stream such as a ObjectOutputStream so I can send things across. Thanks

Sponsor:

#2 joeG   Members   -  Reputation: 172

Like
Likes
Like

Posted 03 August 2000 - 04:58 PM

How were you running it? You should have the servlet on the same server as where you put your webpage for it to work properly. Some web hosting services allow you to do that, others don''t. You might want to check into that. Sandbox rules only allow you to connect to the machine that the applet''s class came from.

Anyways, forgive me if you knew this, but the above solution immediately popped up in my head when I read your request for help.

joeG

#3 Wrathnut   Members   -  Reputation: 370

Like
Likes
Like

Posted 04 August 2000 - 03:29 AM

Try this link... http://java.sun.com/docs/books/tutorial/applet/practical/server.html

I don''t know if that''s quite what you''re looking for.

War doesn't determine who is right, war determines who is left.

#4 Icculus   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 August 2000 - 09:25 PM

thanks but nevermind, it was a dumb error on my part. I put the servlet in the servlets directory in the jdsk server and thought that was the directory to access it. I actually is the address/servlet for some wierd reason instead. Anyway I tried the above page and got a exception too, since it uses datagram sockets. I guess I''ll have to do http communication but it is not as good as Sockets since the applet had to refresh every so often to get info. Has anyone used Sockets without security problems between a applet and a servlet?

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 05 August 2000 - 02:56 PM

I know it is possible... I read something on it, but cannot remember where. Is the applet being served off of the same server that the servlet resides on? That can cause problems with security

#6 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 21 October 2000 - 08:07 AM

I''m trying to find some good information about this subject too. I have to transfer binary data from my applet to a servlet, but I haven''t been able to find any information about it. All I''ve been able to find, is comments about a supposedly great book from o''reilly. Anyone have the book "Java Servlet Programming"? I''d like to know whether or not it contains any valuable info about the subject.

#7 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 2000 - 10:17 AM

I have done applet to server communication. I haven''t bothered with the servlet part. It seems rather overkill to wrap you server behind an http server.

#8 Bruce   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 2000 - 10:30 AM

If you use the javax.servlet API, you will probably use the javax.servlet.http.HttpServlet class that generates HTTP content. Instead, use the javax.servlet.GenericServlet and implement the service method.Good links:
http://java.sun.com/products/servlet/?frontpage-javaplatform
http://java.sun.com/products/servlet/2.2/javadoc/index.html

#9 Neurotic   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 October 2000 - 12:48 PM

I''ve done applet to server communication before as well... I think it was a simple chat app.

I wonder what your doing thats causing the Security Exception?

Can we get some code?

Mark

----
http://go.to/e[m]anate
----




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS