dtrusty-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org
2007-Sep-21 13:57 UTC
How do I "render" a Java applet from a controller?
Hi, I need to render the results of another program, which are stored in the form of applets, each stored in their own directories. The applet-related data is referenced in a plain html file, which contains statements like this: <html> <head> <title>XOPmeet Playback</title> </head> <body TOPMARGIN=0 BOTTOMMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 MARGINHEIGHT=0 MARGINWIDTH=0 SCROLL="NO"> <applet code=com.sts.webmeet.client.AWTClient.class archive="webhuddle_voip.jar,clientproperties.jar,jl1.0.jar" ......... I can render the above plain html file from my controller with no problems. However, the browser sees that applet tag and then sends in a GET request like this: GET /report/play_webrec/com/sts/webmeet/client/AWTClient.class That "com/...." part of the path is within one of the jar files. I need to control access to the applets, so I cannot just place the applet related code in the public side of the web site. How can I send applets from within a Rails controller? Thanks! David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Robert Walker
2007-Sep-21 15:29 UTC
Re: How do I "render" a Java applet from a controller?
Not sure if this is a problem, but the applet tag is deprecate in favor of the object tag.Check the object tag syntax at http://www.w3.org. On Sep 21, 9:57 am, "dtru...-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org" <dtru...-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org> wrote:> Hi, > > I need to render the results of another program, which are stored in > the form > of applets, each stored in their own directories. > > The applet-related data is referenced in a plain html file, which > contains > statements like this: > > <html> > <head> > <title>XOPmeet Playback</title> > </head> > <body TOPMARGIN=0 BOTTOMMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 > MARGINHEIGHT=0 MARGINWIDTH=0 SCROLL="NO"> > <applet > code=com.sts.webmeet.client.AWTClient.class > > archive="webhuddle_voip.jar,clientproperties.jar,jl1.0.jar" > ......... > > I can render the above plain html file from my controller with no > problems. However, > the browser sees that applet tag and then sends in a GET request like > this: > > GET /report/play_webrec/com/sts/webmeet/client/AWTClient.class > > That "com/...." part of the path is within one of the jar files. > > I need to control access to the applets, so I cannot just place the > applet related > code in the public side of the web site. > > How can I send applets from within a Rails controller? > > Thanks! > > David--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dtrusty-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org
2007-Sep-22 20:06 UTC
Re: How do I "render" a Java applet from a controller?
On Sep 21, 10:29 am, Robert Walker <rwalker...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Not sure if this is a problem, but the applet tag is deprecate in > favor of the object tag.Check the object tag syntax athttp://www.w3.org. > > On Sep 21, 9:57 am, "dtru...-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org" <dtru...-U6r7FCv0h4VBDgjK7y7TUQ@public.gmane.org> wrote: > > > Hi, > > > I need to render the results of another program, which are stored in > > the form > > of applets, each stored in their own directories. > > > The applet-related data is referenced in a plain html file, which > > contains > > statements like this: > > > <html> > > <head> > > <title>XOPmeet Playback</title> > > </head> > > <body TOPMARGIN=0 BOTTOMMARGIN=0 LEFTMARGIN=0 RIGHTMARGIN=0 > > MARGINHEIGHT=0 MARGINWIDTH=0 SCROLL="NO"> > > <applet > > code=com.sts.webmeet.client.AWTClient.class > > > archive="webhuddle_voip.jar,clientproperties.jar,jl1.0.jar" > > ......... > > > I can render the above plain html file from my controller with no > > problems. However, > > the browser sees that applet tag and then sends in a GET request like > > this: > > > GET /report/play_webrec/com/sts/webmeet/client/AWTClient.class > > > That "com/...." part of the path is within one of the jar files. > > > I need to control access to the applets, so I cannot just place the > > applet related > > code in the public side of the web site. > > > How can I send applets from within a Rails controller? > > > Thanks! > > > DavidOK..I got it to work much better. It turns out that the browser was requesting the jar file, and if it encountered any error, was trying to request that AWT class file (which is inside the jar file). I now have another interesting problem. It seems that the browser will request the same jar file multiple times, which I send in my controller, via the send_file helper. Since the browser requests the same file many times (maybe up to 10 times), the applet appears very slow. I noticed that applets served from the public side of the web server don''t have this problem. The web server seems to send some "304 Not Modified". I tried to do this in my controller, but the broswer/applet didn''t seem to like it. Any ideas? Thanks, David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---