Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Using a java applet
5 Posts
Using a java applet

hi all i have had same problem.

thanks to all! to the next tip!

I don't think anything is needed in routes.rb if the files physically exist in the public folder. I think the problem in this case is that the applet files were installed in the wrong place.

If you are trying to load an applet called applet.TstApplet, you need to have the following file: RAILS_ROOT/public/applet/TstApplet.class

i.e. the java package hierarchy gets turned into a directory hierarchy.

thanks!

Paulo, you will need to setup a route in ./config/routes.rb that looks something like this:

map.connect '/applet'

I have a simple rails application. In a web page I want to use a Java applet. To do so, I put the jar file of this applet on the public folder of my rails application.

The code I am using to execute the applet on my page is the following one:

...

However, when I execute the application I have the following error:

ActionController::RoutingError (no route found to match "/applet/TstApplet.class " with {:method=>:get}):

D:/Programs/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/a

ction_controller/routing.rb:1292:in `recognize_path'

D:/Programs/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/a

ction_controller/routing.rb:1282:in `recognize'

D:/Programs/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatc

her.rb:40:in `dispatch'

Am I doing something wrong or it is just not possible to execute a java applet into a web page of a rails application?

Thank you

Regards

5 Posts
Login to add your message